why? <form name="myFormName" method="get" action=" "> <noscript> <div> turned ON SCRIPTS </div> </noscript> <script type="text/javascript"> function displayRandomAd() { //store the adverts in arrays heading = new Array(); theAdText = new Array(); heading[0] = "<script type="text/javascript"><!-- ch_client = "xxxx"; ch_width = 250; ch_height = 250; var ch_queries = new Array( "phone" ); var ch_selected=Math.floor((Math.random()*ch_queries.length)); if ( ch_selected < ch_queries.length ) { ch_query = ch_queries[ch_selected]; } //--></script> <script src="http://scripts.chitika.net/eminimalls/mm.js" type="text/javascript"> </script>"; theAdText[0] = "" + ""; heading[1] = "<script type="text/javascript"><!-- ch_client = "xxxx"; ch_width = 250; ch_height = 250; var ch_queries = new Array( "labtop" ); var ch_selected=Math.floor((Math.random()*ch_queries.length)); if ( ch_selected < ch_queries.length ) { ch_query = ch_queries[ch_selected]; } //--></script> <script src="http://scripts.chitika.net/eminimalls/mm.js" type="text/javascript"> </script>"; theAdText[1] = "" + ""; heading[2] = "<script type="text/javascript"><!-- ch_client = "xxxx"; ch_width = 250; ch_height = 250; var ch_queries = new Array( "camera" ); var ch_selected=Math.floor((Math.random()*ch_queries.length)); if ( ch_selected < ch_queries.length ) { ch_query = ch_queries[ch_selected]; } //--></script> <script src="http://scripts.chitika.net/eminimalls/mm.js" type="text/javascript"> </script>"; theAdText[2] = "" + ""; //calculate a random index // NB the more ads you have, the less likely it is to see the same one twice in a row index = Math.floor(Math.random() * theAdText.length); //display the ad document.write( '' + '<h4> ' + heading[index] + '<\/h4>' + '<p>' + theAdText[index] + '\n' + '<\/p>' ); //done } </script> <script type="text/javascript"> displayRandomAd(); </script> </form>
I'd guess cause of all the "" in there and no \ to cancel them out. If it's not that then i'll take a better look
It's not rocket science that if you have a variable saying variable="Whatever" then if the Whatever part has "s in it then it will stop the variable short of what you want. Fixed it up there anyway. I accept all forms of rep