Reputation: 2001
Well, question maybe doesn't correct, but I give a shoot.
My script:
<a href="javascript:var%20u=location.href;window.open('http://localhost/url='+u);void(o)" onclick="return false">OMG, testing</a>
In real, without javascript url look like:
http://localhost/url=google.com
In here wanna add this: &format=txt
So, the correct url then would be:
http://localhost/url=google.com&format=txt
Upvotes: 0
Views: 1347
Reputation: 2471
This will do it ,, you have to do same as you did for the localhost
<a href="javascript:var%20u=location.href;window.open('http://localhost/url='+u+'&format='+txt);void(o)" onclick="return false">OMG, testing</a>
Upvotes: 1
Reputation: 2863
Just add it to the link using +, unless I misunderstood the question.
<a href="javascript:var%20u=location.href;window.open('http://localhost/url='+u+'&format='+txt);void(o)" onclick="return false">OMG, testing</a>
Assumes txt is a variable, otherwise put it all in the quotes.
Upvotes: 1
Reputation: 8333
is this what you want:
<a href="javascript:var%20u=location.href;window.open('http://localhost/url='+u+'&format=txt');void(o)" onclick="return false">OMG, testing</a>
Upvotes: 1
Reputation: 2654
like that :
<a href="javascript:var%20u=location.href;window.open('http://localhost/url='+u + '&format=txt');void(o)" onclick="return false">OMG, testing</a>
You only have to add the text to the string of your url
Upvotes: 0