PDA

View Full Version : Banner (java script) wont work



JACKLH
07-13-2008, 04:58 PM
How do i put a java script banner on on my website using page wizard (help please).
http://sfi-eyeearn.com

HERE IS THE BANNER CODE.

<script type="text/javascript" src=http://www.bluehost.com/src/js/jacklh/CODE11/180x150/2.gif></script>

Eriksrocks
07-13-2008, 06:25 PM
Umm, well first, you need to have quotes around the src attribute:
<script type="text/javascript" src="http://www.bluehost.com/src/js/jacklh/CODE11/180x150/2.gif"></script>

But you're biggest problem is that you're referencing an image in the script tag - images aren't Javascript. ;)

In Page Wizard, you'll have to click the edit HTML button or View/Edit Source and insert the code manually. :)

Early Out
07-13-2008, 08:16 PM
No, that's actually the way BH affiliate links get embedded in the HTML - no quotes around the URL, and it actually is called as Javascript. To check it out, login to the BH affiliate site (https://www.bluehost.com/cgi-bin/partner/), and hit the Affiliate Link Code tab.

Eriksrocks
07-13-2008, 10:07 PM
No, that's actually the way BH affiliate links get embedded in the HTML - no quotes around the URL, and it actually is called as Javascript. To check it out, login to the BH affiliate site (https://www.bluehost.com/cgi-bin/partner/), and hit the Affiliate Link Code tab.

Interesting, I never actually looked at the code they provided for the banners. :)

So, in that case, just insert it into the source as I described earlier. Although if you look at the Javascript that it references, it's very simple:

document.write('<a href=http://www.bluehost.com/track/jacklh/CODE11 target=_top><img border=0 src=http://img.bluehost.com/180x150/2.gif></a>');

If I were you I would simply put the code that it writes directly on the page:

<a href=http://www.bluehost.com/track/jacklh/CODE11 target=_top><img border=0 src=http://img.bluehost.com/180x150/2.gif></a>


Again you can see that it doesn't put the attributes in quotes. That's most likely not W3C compliant, so if you're putting this on a page that you wish to be W3C compliant, you'll probably want to put quotes in where they should be. :)