473,394 Members | 1,770 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Script won't work in IE

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
7 1490
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: jock | last post by:
A script i'm working on is behaving real strange. It is more or less the same as dozens of others that work aok. Info is posted from one script to another, the second script does some work...
2
by: Ralf Schneider | last post by:
Hi there, can anybody help me? It won't work! Why? My declaration: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html...
4
by: Wm | last post by:
I have a script that changes a main/enlarged image when you click on a thumbnail. It works fine in IE, but for some reason it won't do anything in Netscape 7.1. Does anyone know if this is a...
2
by: webbedfeet | last post by:
Hi I hope someone can help me. I have a client side form validation script which works perfectly in IE but clicking "Submit" in Mozilla does nothing - the form won't submit. Is there something I...
20
by: Tammy | last post by:
What would be a good alternative to using frames? I need something that will section my webpage into two halves and can change both frames on a single click. Thanks in Advance, Tammy
4
by: petermichaux | last post by:
Hi, I'm hoping for a reason I'm wrong or an alternate solution... I'd like to be able to dynamically include some javascript files. This is like scriptaculous.js library but their solution is...
2
by: Hari Sekhon | last post by:
I want to wrap a whole script in try ... except. What is the best way of doing this? Consider the following: - try: import <modules> <CODE>
17
by: PJ | last post by:
Greetings... I have stumbled upon a small problem. I use Ajax to retrieve part of a page I need to update. I update a DIV element with the HTML contents I get from another page. It works...
4
by: dbee | last post by:
Right. I've got a really, really annoying/difficult/time consuming problem with my development environment. I'm using django to build a web app with paypal integration. My server is hosted...
5
by: inetquestion | last post by:
I am looking for a web interface for shell commands or shell scripts. Does anyone know of any exexisting php scripts which would solve this requirement? PHP form accepts input from a user, then...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.