how do you insert javascript into a cell in index.template.php

Started by dsdc, December 04, 2004, 08:32:59 AM

Previous topic - Next topic

dsdc

Hello-

I would like to replace the smf logo in  index.template.php file with banner rotation code, which is in javascript.

Thought by simply deleting the line of code that calls the logo and pasting in the javascript would do it, but it isn't.  Got an error page about parsing instead of the forum after I tried that.

The javascript calls a nice standard banner into that space, and then rotates it.

Can anyone tell me how to accomplish this so the javascript and php codes can play nice together?

Thanks

Jerry

Sounds like you probably have some 's in you js script, make sure you replace 's with \'


- Jerry
Find me on:
Facebook
Twitter
PlanetSMF

"If all you look for is the negative in things, you will never see the positive."

dsdc

Thanks for the suggestion.  I tried it, and it didn't seem to help.

Here is the javascript, if that is useful.  I inserted it between the <td></td> tags.


<script language='JavaScript' type='text/javascript'>
<!--
   if (!document.phpAds_used) document.phpAds_used = ',';
   phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);
   
   document.write ("<" + "script language='JavaScript' type='text/javascript' src='");
   document.write ("http://mydomainname.com/exchange/adjs.php?n= [nofollow]" + phpAds_random);
   document.write ("&amp;what=zone:2");
   document.write ("&amp;exclude=" + document.phpAds_used);
   if (document.referer)
      document.write ("&amp;referer=" + escape(document.referer));
   document.write ("'><" + "/script>");
//-->
</script><noscript><a href='http://mydomainname.com/exchange/adclick.php?n=a3ad2c43' [nofollow]; target='_blank'><img src='http://mydomainname.com/exchange/adview.php?what=zone:2&amp;n=a3ad2c43' [nofollow]; border='0' alt=''></a></noscript>

Other ideas?

Jerry

I replaced the 's with \' it seemed to work . .

<script language=\'JavaScript\' type=\'text/javascript\'>
<!--
   if (!document.phpAds_used) document.phpAds_used = \',\';
   phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);
   
   document.write ("<" + "script language=\'JavaScript\' type=\'text/javascript\' src=\'");
   document.write ("http://mydomainname.com/exchange/adjs.php?n=" + phpAds_random);
   document.write ("&amp;what=zone:2");
   document.write ("&amp;exclude=" + document.phpAds_used);
   if (document.referer)
      document.write ("&amp;referer=" + escape(document.referer));
   document.write ("\'><" + "/script>");
//-->
</script><noscript><a href=\'http://mydomainname.com/exchange/adclick.php?n=a3ad2c43\' target=\'_blank\'><img src=\'http://mydomainname.com/exchange/adview.php?what=zone:2&amp;n=a3ad2c43\' border=\'0\' alt=\'\'></a></noscript>


- Jerry
Find me on:
Facebook
Twitter
PlanetSMF

"If all you look for is the negative in things, you will never see the positive."

dsdc

That did the trick, Jerry.  I must have missed one.

Thanks for helping.

Advertisement: