<legend id='ELqN6'><style id='ELqN6'><dir id='ELqN6'><q id='ELqN6'></q></dir></style></legend>
  • <tfoot id='ELqN6'></tfoot>

    <small id='ELqN6'></small><noframes id='ELqN6'>

    <i id='ELqN6'><tr id='ELqN6'><dt id='ELqN6'><q id='ELqN6'><span id='ELqN6'><b id='ELqN6'><form id='ELqN6'><ins id='ELqN6'></ins><ul id='ELqN6'></ul><sub id='ELqN6'></sub></form><legend id='ELqN6'></legend><bdo id='ELqN6'><pre id='ELqN6'><center id='ELqN6'></center></pre></bdo></b><th id='ELqN6'></th></span></q></dt></tr></i><div id='ELqN6'><tfoot id='ELqN6'></tfoot><dl id='ELqN6'><fieldset id='ELqN6'></fieldset></dl></div>
      <bdo id='ELqN6'></bdo><ul id='ELqN6'></ul>

      1. 将 PHP 变量发送到 javascript 函数

        Send PHP variable to javascript function(将 PHP 变量发送到 javascript 函数)

          <tfoot id='aXI4R'></tfoot>
        1. <legend id='aXI4R'><style id='aXI4R'><dir id='aXI4R'><q id='aXI4R'></q></dir></style></legend>
            <tbody id='aXI4R'></tbody>
            <bdo id='aXI4R'></bdo><ul id='aXI4R'></ul>

            <i id='aXI4R'><tr id='aXI4R'><dt id='aXI4R'><q id='aXI4R'><span id='aXI4R'><b id='aXI4R'><form id='aXI4R'><ins id='aXI4R'></ins><ul id='aXI4R'></ul><sub id='aXI4R'></sub></form><legend id='aXI4R'></legend><bdo id='aXI4R'><pre id='aXI4R'><center id='aXI4R'></center></pre></bdo></b><th id='aXI4R'></th></span></q></dt></tr></i><div id='aXI4R'><tfoot id='aXI4R'></tfoot><dl id='aXI4R'><fieldset id='aXI4R'></fieldset></dl></div>

              <small id='aXI4R'></small><noframes id='aXI4R'>

                1. 本文介绍了将 PHP 变量发送到 javascript 函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个生成变量的 php 文件,我希望将该变量放入一个 javascript 函数中,该函数由主页上的 onclick 调用.这可以从 PHP 发送到 javascript 吗?

                  I have a php file that generates a variable and I would like the variable to be put into a javascript function which is called by onclick on the main page. Is this possible to send from PHP to javascript?

                  推荐答案

                  您可以执行以下操作:

                  <script type='text/javascript'>
                      document.body.onclick(function(){
                          var myVariable = <?php echo(json_encode($myVariable)); ?>;
                      };
                  </script>
                  

                  这篇关于将 PHP 变量发送到 javascript 函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Appending GET parameters to URL from lt;formgt; action(将 GET 参数附加到来自 lt;formgt; 的 URL行动)
                  Forcing quot;Save Asquot; dialog via jQuery GET(强制“另存为通过 jQuery GET 对话框)
                  PHP - get certain word from string(PHP - 从字符串中获取某个单词)
                  How to debug a get request in php using curl(如何使用 curl 在 php 中调试 get 请求)
                  get a # from a url in php(从 php 中的 url 获取 #)
                  PHP - include() file not working when variables are put in url?(PHP - 将变量放入 url 时,include() 文件不起作用?)
                  • <bdo id='LQvMQ'></bdo><ul id='LQvMQ'></ul>
                      <legend id='LQvMQ'><style id='LQvMQ'><dir id='LQvMQ'><q id='LQvMQ'></q></dir></style></legend>

                            <tfoot id='LQvMQ'></tfoot>
                              <tbody id='LQvMQ'></tbody>
                            <i id='LQvMQ'><tr id='LQvMQ'><dt id='LQvMQ'><q id='LQvMQ'><span id='LQvMQ'><b id='LQvMQ'><form id='LQvMQ'><ins id='LQvMQ'></ins><ul id='LQvMQ'></ul><sub id='LQvMQ'></sub></form><legend id='LQvMQ'></legend><bdo id='LQvMQ'><pre id='LQvMQ'><center id='LQvMQ'></center></pre></bdo></b><th id='LQvMQ'></th></span></q></dt></tr></i><div id='LQvMQ'><tfoot id='LQvMQ'></tfoot><dl id='LQvMQ'><fieldset id='LQvMQ'></fieldset></dl></div>

                            <small id='LQvMQ'></small><noframes id='LQvMQ'>