17488 Posts in 4473 Topics by 1978 members
| Go to End | Next > | |
| Author | Topic: | 2688 Views |
-
Banners on silverstripe

31 July 2008 at 9:23pm
Hi I been trying to figue out how to put banners on my homepage. I enrolled with a banner affiliate program, they generated some javascript code. I tried to implement the code in page.ss but then i foundout that there should not be any code in that page.
How would the best way to implement the javascript code be?
The code looks like this.
script type="text/javascript"
var uri = 'http://imp.tradedoubler.com/imp?type(js)pool(281627)a(1545256)' + new String (Math.random()).substring (2, 11);
document.write('<sc'+'ript type="text/javascript" src="'+uri+'" charset="ISO-8859-1"></sc'+'ript>');
/script -
Re: Banners on silverstripe

1 August 2008 at 8:51pm
Any got a clue on this I searched the forum but have not find any answer that made me understand it.
Joakim
-
Re: Banners on silverstripe

1 August 2008 at 9:59pm
It doesn't work if you just put the code in your template for the homepage ?
-
Re: Banners on silverstripe

5 August 2008 at 12:48am
Shall i put the javascript in the folder sapphire/javascript?
And how do I include it inthe pages, as an include in the templates?Joakim
-
Re: Banners on silverstripe

7 August 2008 at 1:00am
Try pasting your piece of script in the appropriate template (e.g. homepage.ss).
-
Re: Banners on silverstripe

7 August 2008 at 4:01am
when i insert it on the page.ss i will get an error about xml not wellformated
but if i delete the
document.write('<sc'+'ript type="text/javascript" src="'+uri+'" charset="ISO-8859-1"></sc'+'ript>');
then i will not receive an error so i guess it something wrong with this part document.write('<sc'+'riptHow would be the best way to solve this?
-
Re: Banners on silverstripe

7 August 2008 at 10:20am
Hmmm... weird... Never had that before...
Try to place it in a CDATA block...
e.g. :
<script>
<![CDATA[your script here ....
]]>
</script>
| 2688 Views | ||
| Go to Top | Next > |


