![]() ![]() |
Could someone make a script so that when I click a link of this format:
This: "&temporaryStatus=0" is added to the end of the URL? Thaaank yaa! |
![]() ![]() |
stuff = document.getElementsByTagName("A");
for (var i = 0; i < stuff.length; i++) {
stuff[i].href = stuff[i].href.replace(/^(http:\/\/[A-Za-z0-9\.]+\.com\/tos\.php\?id=.+?)$/, "$1&temporaryStatus=0");
}
I tested it with these: <a href="http://example.com/tos.php?id=1">example 1</a> <a href="http://www.example.com/tos.php?id=02">example 2</a> <a href="http://www.example.com/tos.php?id=">example 3</a> <a href="http://www.example.com.au/tos.php?id=04">example 4</a> Note that
It's probably best if you give links to example pages. My code checks all the links on the page - and you probably only need to check parts of the page.
example.com
Also - having examples helps to find problems and bugs. Without examples - I have no way of knowing if my code will actually work correctly. __________________
I just realized that my code fails on links that start with https Do you want https links checked too? |
![]() ![]() |
Thanks a lot! It's works perfectly. It does exactly what I needed it to. The only links that I needed the script were of the format I posted above. i.e. no https |

