Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/252.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用<;将javascript变量传递到php页面;a>;在popup.html浏览器扩展中添加标记?_Javascript_Php_Html_Google Chrome Extension - Fatal编程技术网

如何使用<;将javascript变量传递到php页面;a>;在popup.html浏览器扩展中添加标记?

如何使用<;将javascript变量传递到php页面;a>;在popup.html浏览器扩展中添加标记?,javascript,php,html,google-chrome-extension,Javascript,Php,Html,Google Chrome Extension,我正在开发一个chrome扩展,我正在使用外部JavaScript获取当前选项卡的URL。现在我想使用锚标记将扩展中显示的URL发送到另一个php页面(php页面将在newtab中打开,它需要获取URL以在某个文本字段中显示) 请帮我怎么做。。提前谢谢 我试过stackoverflow.com上的许多代码片段,它们可以作为独立脚本正常工作,但当我在chrome扩展中使用相同的脚本时,它们就不工作了 <!DOCTYPE html> <html> &l

我正在开发一个chrome扩展,我正在使用外部JavaScript获取当前选项卡的URL。现在我想使用锚标记将扩展中显示的URL发送到另一个php页面(php页面将在newtab中打开,它需要获取URL以在某个文本字段中显示)

请帮我怎么做。。提前谢谢

我试过stackoverflow.com上的许多代码片段,它们可以作为独立脚本正常工作,但当我在chrome扩展中使用相同的脚本时,它们就不工作了

    <!DOCTYPE html>
    <html>
    <head>
    <script type="text/javascript" src="aj1.js"></script>
    </head>
    <h2 class="ba2">My first chrome extenstion!!!</h2>
    <b>Current URL:</b><p id="demo"></p>
    <script type="text/javascript">
    var url = //i am getting url;
    //variable url has current tabs url
    </script>
   <a href="http://localhost/alternative/page01.php" target="_blank">Click Here to go to php</a>
    </body>
    </html>

我的第一个chrome扩展!!!
当前URL:

var url=//我正在获取url; //变量url具有当前选项卡url

我可以发送带有标签的变量url吗???

给出一些您尝试过的代码我已经编辑了我的问题并包含了我的popup.html代码片段。