Unable to put a Javascript in the templates
2 posters
Page 1 of 1
Unable to put a Javascript in the templates
Greetings, I've been trying to put a Javascript which is a dynamically changing banner w/ links, just like Advertisement Rotation or so.. But fortunately i can not do so, because somehow the "banners" are not showing up.
The javascript should be like that:
But it's not shown in my forums.., the "xxxxx" and stuff are replacement just not to advertise here, but the code is actually correct!
The javascript should be like that:
- Code:
<script>
var img_width = "468";
var img_height = "60";
var img_title = "Click Here";
var ad=new Array()
ad[0]='xxxxxx';
ad[1]='xxxxx';
ad[2]='hxxxx';
var links=new Array()
links[0]='http://ixxx';
links[1]='http://axxxxxxxx5';
links[2]='http://ixxxxf=xxxxox';
var xy=Math.floor(Math.random()*ad.length);
document.write('<a href="'+links[xy]+'" target="_blank"><img src="'+ad[xy]+'" width="'+img_width+'" height="'+img_height+'" alt="'+img_title+'"></a>');
</script>
But it's not shown in my forums.., the "xxxxx" and stuff are replacement just not to advertise here, but the code is actually correct!
Last edited by Neoroify on October 12th 2010, 8:44 pm; edited 1 time in total
Neoroify- Forumember
- Posts : 99
Reputation : 0
Language : English
Re: Unable to put a Javascript in the templates
Ehm,, let's change this "<script>" to "<script type="text/javascript">" (:
Guest- Guest
Re: Unable to put a Javascript in the templates
It's still not appearing.. errr.... that's not good :o
Neoroify- Forumember
- Posts : 99
Reputation : 0
Language : English
Re: Unable to put a Javascript in the templates
Go to: http://answers.yahoo.com/question/index?qid=20081024080838AALbYSj that's where i got it from o.0
Neoroify- Forumember
- Posts : 99
Reputation : 0
Language : English
Re: Unable to put a Javascript in the templates
Err, you know what, never mind about that, I've found an other alternative to solve the problem, I used a banner rotation generator. so, probably solved!
Neoroify- Forumember
- Posts : 99
Reputation : 0
Language : English
Re: Unable to put a Javascript in the templates
Yeah that's good it worked for you, but the one i found is.. lol.. returning to my homepage, tho the links are linking to a designated webpage -.-
The code is working properly as previewed at the place of creation, but at my forum, it is not cycling and is leading to my homepage
http://forum.neoroify.eu/ You can see it yourself.. err
The code is working properly as previewed at the place of creation, but at my forum, it is not cycling and is leading to my homepage
http://forum.neoroify.eu/ You can see it yourself.. err
Neoroify- Forumember
- Posts : 99
Reputation : 0
Language : English
Re: Unable to put a Javascript in the templates
You can link scripts so they function properly
when used in templates and widgets.
Create an Html page with the code.
(Example title for the page: code1_js
Get the page Url from Html pages management & link it like this
You can also use a site like →yourjavascript.com to link scripts.
I use yourjavascript.com for scripts that contain dollar signs ($)
since that character is converted to: $ ; when it's saved on
Html pages or in widgets... the end result being a corrupt script.
when used in templates and widgets.
Create an Html page with the code.
(Example title for the page: code1_js
- Code:
var img_width = "468";
var img_height = "60";
var img_title = "Click Here";
var ad=new Array()
ad[0]='xxxxxx';
ad[1]='xxxxx';
ad[2]='hxxxx';
var links=new Array()
links[0]='http://ixxx';
links[1]='http://axxxxxxxx5';
links[2]='http://ixxxxf=xxxxox';
var xy=Math.floor(Math.random()*ad.length);
document.write('<a href="'+links[xy]+'" target="_blank"><img src="'+ad[xy]+'" width="'+img_width+'" height="'+img_height+'" alt="'+img_title+'"></a>');
Get the page Url from Html pages management & link it like this
- Code:
<script src="http:YOUR HTML/SCRIPT PAGE.code1_js.htm" type="text/javascript"></script>
You can also use a site like →yourjavascript.com to link scripts.
I use yourjavascript.com for scripts that contain dollar signs ($)
since that character is converted to: $ ; when it's saved on
Html pages or in widgets... the end result being a corrupt script.
Since an alternative has been found to solve the issue, this topic is closed. |
RoNo |
General rules Tricks & Tips FAQ listing | For founders who lost their passwords About support requests by PM Announcements & Updates |
Similar topics
» Javascript- More then 1 javascript code
» ModernBB - Javascript code management and templates managment
» Unable to create widgets / HTML / Javascript pages/elements
» Totally stuck, unable to login, unable to recall my username.
» Unable to see links/Unable to access forums without logging on
» ModernBB - Javascript code management and templates managment
» Unable to create widgets / HTML / Javascript pages/elements
» Totally stuck, unable to login, unable to recall my username.
» Unable to see links/Unable to access forums without logging on
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum