/    Sign up×
Community /Pin to ProfileBookmark

Wont work in IE9

Hi this JavaScript works in Crome ,firefox,safari but not in Internet Explorer it sends the page layout everywhere.

Any Ideas ?

Thank’s

[CODE] <script language=”JavaScript”>
var slideimages=new Array()
var slidelinks=new Array()

var ImageArr1 = new Array(“images/mefish.jpg”,”images/rsz_prebait_world.png”,”images/logo_flymen.png”);
var ImageHolder1 = document.getElementById(‘Rotating1’);
/* var LinkArr1 = new Array(<a id=”Link1″ href=”http://youtube.com”>,<a id=”Link1″ href=”http://hotmail.com”>,<a id=”Link1″ href=”http://hotmail.com”>);
var LinkHolder1= document.getElementById(‘Link1’);*/

var ImageArr2 = new Array(“images/may.jpg”,”images/mefish.jpg”,”images/rsz_prebait_world.png”);
var ImageHolder2 = document.getElementById(‘Rotating2’);
/* var LinkArr2 = new Array(<a id=”Link4″ href=”http://youtube.com”>,<a id=”Link5″ href=”http://youtube.com”>,<a id=”Link6″ href=”http://youtube.com”>);
var LinkHolder2= document.getElementById(‘Link1’);*/

RotateImages(1,0);
RotateImages(2,0);

</script> [/CODE]

The commented out lines are where i could not get each picture to have its own link ,but only noticed that it does not work in IE with this Script ?

[CODE] <a href=”javascript:RotateImages()”> <img scr=”images/may.jpg” name=”Rotating” id=”Rotating1″ width=100 height=100></a>
<hr />
<a href=”javascript:RotateImages()”> <img scr=”images/rsz_prebait_world.png” name=”Rotating” id=”Rotating2″ width=100 height=100> </a>

<script language=”JavaScript”>
var slideimages=new Array()
var slidelinks=new Array()

var ImageArr1 = new Array(“images/mefish.jpg”,”images/rsz_prebait_world.png”,”images/logo_flymen.png”);
var ImageHolder1 = document.getElementById(‘Rotating1’);
/* var LinkArr1 = new Array(<a id=”Link1″ href=”http://youtube.com”>,<a id=”Link1″ href=”http://hotmail.com”>,<a id=”Link1″ href=”http://hotmail.com”>);
var LinkHolder1= document.getElementById(‘Link1’);*/

var ImageArr2 = new Array(“images/may.jpg”,”images/mefish.jpg”,”images/rsz_prebait_world.png”);
var ImageHolder2 = document.getElementById(‘Rotating2’);
/* var LinkArr2 = new Array(<a id=”Link4″ href=”http://youtube.com”>,<a id=”Link5″ href=”http://youtube.com”>,<a id=”Link6″ href=”http://youtube.com”>);
var LinkHolder2= document.getElementById(‘Link1’);*/

RotateImages(1,0);
RotateImages(2,0);

</script>
[/CODE]

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@KorApr 08.2011 — Hi this JavaScript works in Crome ,firefox,safari but not in Internet Explorer it sends the page layout everywhere.[/QUOTE]
Where? can we see the whole picture? A link to a test page would be useful

[I]language[/I] is deprecated. use [B]type[/B] instead
<i>
</i>&lt;script [COLOR="Blue"]type="text/javascript"[/COLOR]&gt;


And:
<i>
</i>&lt;a href="#" onclick="RotateImages();return false"&gt;


By the way, shouldn't you pass 2 arguments to the function RotateImages(x,y)? Where is that function RotateImages(), anyway?
Copy linkTweet thisAlerts:
@aj_nscApr 08.2011 — While Kor is correct, if you're moving on to bigger and better things (or not) you can omit the type attribute entirely.

http://doctype.com/html5-optional-type-property-script

http://dev.w3.org/html5/spec/scripting-1.html#attr-script-type
×

Success!

Help @MASP spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...