473,372 Members | 923 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,372 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 1487
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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...

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.