I hope this helps.Code:<script type="text/javascript"> //****************configuration **********************// //string to look for lookFor="www.house.com/forum"; //HTML to display when the string was NOT found -take care of the proper quotes embedding- // do not add single quotes without addin a \ first HTML1='<img src="http://www.mysolarsystem.com/images/jupiter.jpg">'; //HTML to display when the string was found HTML2='<img src="http://www.mysolarsystem.com/images/saturn.jpg">'; //****************configuration ends here **********************// w=location.href; index=w.indexOf(lookFor); if(index=-1){ //the current URL does not contain searched string document.write(HTML1); } else{ //the current URL contains the searched string document.write(HTML2); } </script>
PS:
Java and javascript are extremely different...






Reply With Quote


Bookmarks