How can i pass a javascript variable to php page using an <a> tag in popup.html chrome extension?

106 views Asked by At

I am developing a chrome extension, and i am getting the current tabs URL using a external JavaScript. Now I want to send the URL which is displayed in the extension to another php page using an anchor tag.(php page is to be opened in newtab and it need to get the URL to display it in some textfield).

Please Help me how to do this.. thanks in advance.

I have tried many code snippets from stackoverflow.com they are working fine as stand alone scripts but when i use the same scripts in my chrome extension they are not working.

    <!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>

Can i send variable url with tag??

0

There are 0 answers