Javascript

Caporegime
Joined
25 Jul 2005
Posts
28,851
Location
Canada
I have a set of rotating linked images on a site I am making but it uses javascript to rotate them, problem is IE stops them appearing and sticks the activex yellow bar at the top.

Obviously no one is actually going to allow activex to run from a site so I was wondering if there was a different code I could use to do the same thing without javascript? :)

Code I am using at the moment
Code:
<SCRIPT language=JavaScript>


var img_width = "468";
var img_height = "60";
var img_title = "Click Here";


var ad=new Array()
//insert here your images src
ad[0]='http://www.site.com/image1';
ad[1]='http://www.site.com/image2';
ad[2]='http://www.site.com/image3';
ad[3]='http://www.site.com/image4';
ad[4]='http://www.site.com/image5';

var links=new Array()
//insert here your links
links[0]='http://www.links1';
links[1]='http://www.links2';
links[2]='http://www.links3';
links[3]='http://www.links4';
links[4]='http://www.links5';

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>
 
Nothing wrong with the code mate, its because your not running it on a webserver. If you upload the file, you will see IE doesnt mind the code, its sorta weird, but trust me, it makes a difference lol
 
Javascript is client side, it shouldn't matter whether it's running on a webserver or not...
 
daz said:
Javascript is client side, it shouldn't matter whether it's running on a webserver or not...

lol it doesnt? try running that code from your desktop, and then try running it online.
I know very well its clientside, firefox doesnt have any problems with it, but its a silly security feature in IE which causes it
 
hmmmm said:
lol it doesnt? try running that code from your desktop, and then try running it online.
I know very well its clientside, firefox doesnt have any problems with it, but its a silly security feature in IE which causes it

Fair enough, damn IE.
 
Back
Top Bottom