The span style was definitely not going to work, it contained double quotes, while you can only resort to single quotes (apostrophe, the word exists, in english ?) because the javascript is already using double quotes.
But the other one looked okay to me...
Did you try escaping all special characters, like the ? with & amp ; or the € with & euro ; ?
(I added spaces, not sure if phpbb wouldn't convert it by himself otherwise)
Or else, try experimenting with super simple syntax, bit.ly links to remove everything fishy, you see the idea...
Rotating banner script
Re: Rotating banner script
I can't find what made the big "works VS doesn't work" difference between the first and second versions O_o
- cooper88
- Moderator
- Posts: 4055
- Joined: Sat May 27, 2006 2:54 pm
- Location: None of UR Business
- Contact:
Re: Rotating banner script
Well, 1st off, you are right: A " would break the javascript so either use \" or a ' instead.
2nd, using a span tag wouldn't have much effect since what's inside it is a link and not simple text.
And in the last version Doc showed I almost didn't spot the error it was so BAM in your face:
banners[0] = "Join 100% Free - Webcams/Chat <a target='_blank' href='http://chaturbate.com/affiliates/in/ZmU7/pOjlh/?track=default'>some anchor</a>";
>> That clearly isn't proper html and shouldn't work
2nd, using a span tag wouldn't have much effect since what's inside it is a link and not simple text.
And in the last version Doc showed I almost didn't spot the error it was so BAM in your face:
banners[0] = "Join 100% Free - Webcams/Chat <a target='_blank' href='http://chaturbate.com/affiliates/in/ZmU7/pOjlh/?track=default'>some anchor</a>";
>> That clearly isn't proper html and shouldn't work
...
- Doc
- Moderator and Beast Killer
- Posts: 2978
- Joined: Mon Jun 04, 2007 5:33 pm
- Location: Reporting Posts Since Oct 23. 2007
- Contact:
Re: Rotating banner script
It works fine with this € and /
http://dirtydirtyangels.com/forum/ see just about where it says welcome guest.
oliver:
It might of been the some anchor thing
<a target='_blank' href='http://chaturbate.com/affiliates/in/ZmU7/pOjlh/?track=default'>some anchor</a>
http://dirtydirtyangels.com/forum/ see just about where it says welcome guest.
oliver:
It might of been the some anchor thing
<a target='_blank' href='http://chaturbate.com/affiliates/in/ZmU7/pOjlh/?track=default'>some anchor</a>
- Doc
- Moderator and Beast Killer
- Posts: 2978
- Joined: Mon Jun 04, 2007 5:33 pm
- Location: Reporting Posts Since Oct 23. 2007
- Contact:
Re: Rotating banner script
i finally found the topic. sorry for all the confusion oliver.
Anyway is there anyway of making this so i can do banner rotation?
<script language="JavaScript">
<!--
banners = new Array(2);
banners[0] = "<a style='color:lightblue;' target='_blank' href='http://YOURLINK.com'>YOUR TEXT 1</a></span>";
banners[1] = "<a style='color:red;' target='_blank' href='http://YOURLINK.com'>YOUR TEXT 2</a></span>";
index = Math.floor(Math.random() * banners.length);
document.write(banners[index]);
// -->
</script>
Anyway is there anyway of making this so i can do banner rotation?
<script language="JavaScript">
<!--
banners = new Array(2);
banners[0] = "<a style='color:lightblue;' target='_blank' href='http://YOURLINK.com'>YOUR TEXT 1</a></span>";
banners[1] = "<a style='color:red;' target='_blank' href='http://YOURLINK.com'>YOUR TEXT 2</a></span>";
index = Math.floor(Math.random() * banners.length);
document.write(banners[index]);
// -->
</script>
- cooper88
- Moderator
- Posts: 4055
- Joined: Sat May 27, 2006 2:54 pm
- Location: None of UR Business
- Contact:
Re: Rotating banner script
Erm, wasn't this solved already back in March? Doesn't it work anymore Doc?
I tried it and it is working fine.
BTW, there is no need for the </span> tags, they should be removed.
I tried it and it is working fine.
BTW, there is no need for the </span> tags, they should be removed.
...
- Doc
- Moderator and Beast Killer
- Posts: 2978
- Joined: Mon Jun 04, 2007 5:33 pm
- Location: Reporting Posts Since Oct 23. 2007
- Contact:
Re: Rotating banner script
It worked fine with link/text rotation. I just want to use it on another site, but instead of it rotating text. i would like it to rotate images.
Who is online
Users browsing this forum: No registered users and 4 guests