add parameter to links on page using jquery

Posted by Priyo on Stack Overflow See other posts from Stack Overflow or by Priyo
Published on 2010-04-19T13:00:45Z Indexed on 2010/04/19 13:03 UTC
Read the original article Hit count: 159

Filed under:

How do I add let's say something like ajax=1 to all links on my page with jquery. I will also need to check if the url has existing parameters. for example "http://mysite.com/index.php?pl=132" will have to become "http://mysite.com/index.php?pl=132&ajax=1" Also, if the link does not have any parameters, for example "http://mysite.com/index.php", it will become "http://mysite.com/index.php?ajax=1" I want to load the jquery script on document ready so all links are changed on page load.

Thanks.

© Stack Overflow or respective owner

Related posts about jQuery