Hi there, I'm only familiar with PHP and my JavaScript knowledge is like zero, but this time I have the need for the following javascript: I need a javascript which can search through the html code of the page, find this link http://www.domain.com/all/ads/page-3/terms-word1 word2 word3/ and rewrite it to http://www.domain.de/showcat.php?cat=all&si=word1+word2+word3&sort=1&page=1 I'm reading JavaScript tutorials about innerHTML already, but I can't seem to find a good start. Thanks for the help.
you can use some jquery to do the job: <html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script> $(document).ready(function(){ $("a[href='http://www.domain.com/all/ads/page-3/terms-word1 word2 word3/']").attr("href", "http://www.domain.de/showcat.php?cat=all&si=word1+word2+word3&sort=1&page=1"); }); </script> </head> <html> old link:http://www.domain.com/all/ads/page-3/terms-word1 word2 word3/ <br /><br /> <a href="http://www.domain.com/all/ads/page-3/terms-word1 word2 word3/"> test </a> </html> </html> Code (markup):