By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,784 Members | 3,274 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,784 IT Pros & Developers. It's quick & easy.

Script won't work in IE

P: n/a
The below script, I have been using for many years, stopped working in IE 7.0 all of a sudden.

It works using NS and Firefox.

Anyone know why this is? Did something change in IE 7.0 that may be causing this?

Thanks

Larry

<script language="javascript" type="text/javascript">
<!--
//By George Chiang (http://www.wsabstract.com) More JavaScripts here!
var sound1="MSymca.mid"
var sound2="MSdiscoinferno2.mid"
var sound3="MSfunkytown.mid"
var sound4="MSthehustle.mid"
var sound5="MSboomboom.mid"
var sound6="MSladyinred.mid"
var sound7="MSstrokin.mid"
var sound8="MSmambo5.mid"
var sound9="MSoyocomova.mid"
var sound10="MSsweethomechicago.mid"
var sound11="MSloveintheair.mid"
var sound12="MSilovenightlife2.mid"
var sound13="MScelebration.mid"
var sound14="MSkissuallover.mid"
var x=Math.round(Math.random()*13)
if (x==0) x=sound1
else if (x==1) x=sound2
else if (x==2) x=sound3
else if (x==3) x=sound4
else if (x==4) x=sound5
else if (x==5) x=sound6
else if (x==6) x=sound7
else if (x==7) x=sound8
else if (x==8) x=sound9
else if (x==9) x=sound10
else if (x==10) x=sound11
else if (x==11) x=sound12
else if (x==12) x=sound13
else if (x==13) x=sound14
else x=sound15
if (navigator.appName=="Microsoft Internet Explorer")
document.write('<bgsound src='+'"'+x+'"'+' loop="infinite">')
else
document.write('<embed src='+'"'+x+'"'+'hidden="true" border="0" width="20" height="20" autostart="true" loop="true">')
//-->
</script>

Jun 27 '08 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Larry wrote:
The below script, I have been using for many years, stopped working in
IE 7.0 all of a sudden.

It works using NS and Firefox.

Anyone know why this is? Did something change in IE 7.0 that may be
causing this?

Thanks

Larry

<script language="javascript" type="text/javascript">
<!--
//By George Chiang (http://www.wsabstract.com) More JavaScripts here!
var sound1="MSymca.mid"
var sound2="MSdiscoinferno2.mid"
var sound3="MSfunkytown.mid"
var sound4="MSthehustle.mid"
var sound5="MSboomboom.mid"
var sound6="MSladyinred.mid"
var sound7="MSstrokin.mid"
var sound8="MSmambo5.mid"
var sound9="MSoyocomova.mid"
var sound10="MSsweethomechicago.mid"
var sound11="MSloveintheair.mid"
var sound12="MSilovenightlife2.mid"
var sound13="MScelebration.mid"
var sound14="MSkissuallover.mid"
var x=Math.round(Math.random()*13)
if (x==0) x=sound1
else if (x==1) x=sound2
else if (x==2) x=sound3
else if (x==3) x=sound4
else if (x==4) x=sound5
else if (x==5) x=sound6
else if (x==6) x=sound7
else if (x==7) x=sound8
else if (x==8) x=sound9
else if (x==9) x=sound10
else if (x==10) x=sound11
else if (x==11) x=sound12
else if (x==12) x=sound13
else if (x==13) x=sound14
else x=sound15
if (navigator.appName=="Microsoft Internet Explorer")
document.write('<bgsound src='+'"'+x+'"'+' loop="infinite">')
else
document.write('<embed src='+'"'+x+'"'+'hidden="true" border="0"
width="20" height="20" autostart="true" loop="true">')
//-->
</script>

This is only a comment on your coding style. Have you never heard of
arrays? Look at http://www.w3schools.com/JS/js_obj_array.asp

You could have used:

var sound = new Array("MSymca.mid", "MSdiscoinferno2.mid", ....etc.);
var y = Math.round(Math.random()*13);
var x = sound[y];
if ......
Jun 27 '08 #2

P: n/a
On May 21, 11:03 pm, "Larry" <la...@westernlifeinsurance.comwrote:
The below script, I have been using for many years, stopped working in IE 7.0 all of a sudden.

It works using NS and Firefox.

Anyone know why this is? Did something change in IE 7.0 that may be causing this?

Thanks

Larry

<script language="javascript" type="text/javascript">
<!--
//By George Chiang (http://www.wsabstract.com) More JavaScripts here!
var sound1="MSymca.mid"
var sound2="MSdiscoinferno2.mid"
var sound3="MSfunkytown.mid"
var sound4="MSthehustle.mid"
var sound5="MSboomboom.mid"
var sound6="MSladyinred.mid"
var sound7="MSstrokin.mid"
var sound8="MSmambo5.mid"
var sound9="MSoyocomova.mid"
var sound10="MSsweethomechicago.mid"
var sound11="MSloveintheair.mid"
var sound12="MSilovenightlife2.mid"
var sound13="MScelebration.mid"
var sound14="MSkissuallover.mid"
var x=Math.round(Math.random()*13)
if (x==0) x=sound1
else if (x==1) x=sound2
else if (x==2) x=sound3
else if (x==3) x=sound4
else if (x==4) x=sound5
else if (x==5) x=sound6
else if (x==6) x=sound7
else if (x==7) x=sound8
else if (x==8) x=sound9
else if (x==9) x=sound10
else if (x==10) x=sound11
else if (x==11) x=sound12
else if (x==12) x=sound13
else if (x==13) x=sound14
else x=sound15
if (navigator.appName=="Microsoft Internet Explorer")
document.write('<bgsound src='+'"'+x+'"'+' loop="infinite">')
else
document.write('<embed src='+'"'+x+'"'+'hidden="true" border="0" width="20" height="20" autostart="true" loop="true">')
//-->
</script>
Instead of
if (navigator.appName=="Microsoft Internet Explorer")
I would use:
if (/*@cc_on true || @*/false)
Matt
Jun 27 '08 #3

P: n/a
mmurph211 schreef:
On May 21, 11:03 pm, "Larry" <la...@westernlifeinsurance.comwrote:
>The below script, I have been using for many years, stopped working in IE 7.0 all of a sudden.

It works using NS and Firefox.

Anyone know why this is? Did something change in IE 7.0 that may be causing this?

Thanks

Larry

<script language="javascript" type="text/javascript">
<!--
//By George Chiang (http://www.wsabstract.com) More JavaScripts here!
var sound1="MSymca.mid"
var sound2="MSdiscoinferno2.mid"
var sound3="MSfunkytown.mid"
var sound4="MSthehustle.mid"
var sound5="MSboomboom.mid"
var sound6="MSladyinred.mid"
var sound7="MSstrokin.mid"
var sound8="MSmambo5.mid"
var sound9="MSoyocomova.mid"
var sound10="MSsweethomechicago.mid"
var sound11="MSloveintheair.mid"
var sound12="MSilovenightlife2.mid"
var sound13="MScelebration.mid"
var sound14="MSkissuallover.mid"
var x=Math.round(Math.random()*13)
if (x==0) x=sound1
else if (x==1) x=sound2
else if (x==2) x=sound3
else if (x==3) x=sound4
else if (x==4) x=sound5
else if (x==5) x=sound6
else if (x==6) x=sound7
else if (x==7) x=sound8
else if (x==8) x=sound9
else if (x==9) x=sound10
else if (x==10) x=sound11
else if (x==11) x=sound12
else if (x==12) x=sound13
else if (x==13) x=sound14
else x=sound15
if (navigator.appName=="Microsoft Internet Explorer")
document.write('<bgsound src='+'"'+x+'"'+' loop="infinite">')
else
document.write('<embed src='+'"'+x+'"'+'hidden="true" border="0" width="20" height="20" autostart="true" loop="true">')
//-->
</script>

Instead of
>if (navigator.appName=="Microsoft Internet Explorer")

I would use:
>if (/*@cc_on true || @*/false)
Instead of:
if (/*@cc_on true || @*/false)

I would use:
if (/*@cc_on!@*/!1)

Which also works but is even more incomprehensible. ;-)

For more non-discussion on the subject:
http://dean.edwards.name/weblog/2007/03/sniff/

Regards,
Erwin Moller
>
Matt
Jun 27 '08 #4

P: n/a
Thanks for the suggestion but that does not clear the problem.

The problem is with release 7.0 of IE. The problem did not exist with 6.0. I
have used this code for many years.

Larry

mmurph211 wrote:
| | On May 21, 11:03 pm, "Larry" <la...@westernlifeinsurance.comwrote:
| | | The below script, I have been using for many years, stopped
| | | working in IE 7.0 all of a sudden.
| | |
| | | It works using NS and Firefox.
| | |
| | | Anyone know why this is? Did something change in IE 7.0 that may
| | | be causing this?
| | |
| | | Thanks
| | |
| | | Larry
| | |
| | | <script language="javascript" type="text/javascript">
| | | <!--
| | | //By George Chiang (http://www.wsabstract.com) More JavaScripts
| | | here!
| | | var sound1="MSymca.mid"
| | | var sound2="MSdiscoinferno2.mid"
| | | var sound3="MSfunkytown.mid"
| | | var sound4="MSthehustle.mid"
| | | var sound5="MSboomboom.mid"
| | | var sound6="MSladyinred.mid"
| | | var sound7="MSstrokin.mid"
| | | var sound8="MSmambo5.mid"
| | | var sound9="MSoyocomova.mid"
| | | var sound10="MSsweethomechicago.mid"
| | | var sound11="MSloveintheair.mid"
| | | var sound12="MSilovenightlife2.mid"
| | | var sound13="MScelebration.mid"
| | | var sound14="MSkissuallover.mid"
| | | var x=Math.round(Math.random()*13)
| | | if (x==0) x=sound1
| | | else if (x==1) x=sound2
| | | else if (x==2) x=sound3
| | | else if (x==3) x=sound4
| | | else if (x==4) x=sound5
| | | else if (x==5) x=sound6
| | | else if (x==6) x=sound7
| | | else if (x==7) x=sound8
| | | else if (x==8) x=sound9
| | | else if (x==9) x=sound10
| | | else if (x==10) x=sound11
| | | else if (x==11) x=sound12
| | | else if (x==12) x=sound13
| | | else if (x==13) x=sound14
| | | else x=sound15
| | | if (navigator.appName=="Microsoft Internet Explorer")
| | | document.write('<bgsound src='+'"'+x+'"'+' loop="infinite">')
| | | else
| | | document.write('<embed src='+'"'+x+'"'+'hidden="true" border="0"
| | | width="20" height="20" autostart="true" loop="true">') //-->
| | | </script>
| |
| | Instead of
| | | if (navigator.appName=="Microsoft Internet Explorer")
| |
| | I would use:
| | | if (/*@cc_on true || @*/false)
| |
| | Matt
Jun 27 '08 #5

P: n/a
On May 21, 8:03 pm, "Larry" <la...@westernlifeinsurance.comwrote:
The below script, I have been using for many years, stopped working in IE 7.0 all of a sudden.

It works using NS and Firefox.

Anyone know why this is? Did something change in IE 7.0 that may be causing this?

[deleted]
if (navigator.appName=="Microsoft Internet Explorer")
document.write('<bgsound src='+'"'+x+'"'+' loop="infinite">')
else
document.write('<embed src='+'"'+x+'"'+'hidden="true" border="0" width="20" height="20" autostart="true" loop="true">')
IE7 implemented lots of changes in scripting and related areas. Just
googling for something like "does bgsound work in ie7" would have
gotten you lots of useful data.
Jun 27 '08 #6

P: n/a
Good suggestion.

Spent some time googling but no solution.

Website where code is on is at http://www.dancedk.com/

Sound works with NS and Firefox but not with IE7.

Thanks

Larry

david.karr wrote:
| | On May 21, 8:03 pm, "Larry" <la...@westernlifeinsurance.comwrote:
| | | The below script, I have been using for many years, stopped
| | | working in IE 7.0 all of a sudden.
| | |
| | | It works using NS and Firefox.
| | |
| | | Anyone know why this is? Did something change in IE 7.0 that may
| | | be causing this?
| | |
| | | [deleted]
| | | if (navigator.appName=="Microsoft Internet Explorer")
| | | document.write('<bgsound src='+'"'+x+'"'+' loop="infinite">')
| | | else
| | | document.write('<embed src='+'"'+x+'"'+'hidden="true" border="0"
| | | width="20" height="20" autostart="true" loop="true">')
| |
| | IE7 implemented lots of changes in scripting and related areas.
| | Just googling for something like "does bgsound work in ie7" would
| | have gotten you lots of useful data.
Jun 27 '08 #7

P: n/a
Just figured it out.

Security setting in IE was set to high.

Thanks for help.

Larry

Larry wrote:
| The below script, I have been using for many years, stopped working
| in IE 7.0 all of a sudden.
|
| It works using NS and Firefox.
|
| Anyone know why this is? Did something change in IE 7.0 that may be
| causing this?
|
| Thanks
|
| Larry
|
| <script language="javascript" type="text/javascript">
| <!--
| //By George Chiang (http://www.wsabstract.com) More JavaScripts here!
| var sound1="MSymca.mid"
| var sound2="MSdiscoinferno2.mid"
| var sound3="MSfunkytown.mid"
| var sound4="MSthehustle.mid"
| var sound5="MSboomboom.mid"
| var sound6="MSladyinred.mid"
| var sound7="MSstrokin.mid"
| var sound8="MSmambo5.mid"
| var sound9="MSoyocomova.mid"
| var sound10="MSsweethomechicago.mid"
| var sound11="MSloveintheair.mid"
| var sound12="MSilovenightlife2.mid"
| var sound13="MScelebration.mid"
| var sound14="MSkissuallover.mid"
| var x=Math.round(Math.random()*13)
| if (x==0) x=sound1
| else if (x==1) x=sound2
| else if (x==2) x=sound3
| else if (x==3) x=sound4
| else if (x==4) x=sound5
| else if (x==5) x=sound6
| else if (x==6) x=sound7
| else if (x==7) x=sound8
| else if (x==8) x=sound9
| else if (x==9) x=sound10
| else if (x==10) x=sound11
| else if (x==11) x=sound12
| else if (x==12) x=sound13
| else if (x==13) x=sound14
| else x=sound15
| if (navigator.appName=="Microsoft Internet Explorer")
| document.write('<bgsound src='+'"'+x+'"'+' loop="infinite">')
| else
| document.write('<embed src='+'"'+x+'"'+'hidden="true" border="0"
| width="20" height="20" autostart="true" loop="true">')
| //-->
| </script>
Jun 27 '08 #8

This discussion thread is closed

Replies have been disabled for this discussion.