Script won't work in IE

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Larry

    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="javas cript" type="text/javascript">
    <!--
    //By George Chiang (http://www.wsabstract.com) More JavaScripts here!
    var sound1="MSymca. mid"
    var sound2="MSdisco inferno2.mid"
    var sound3="MSfunky town.mid"
    var sound4="MSthehu stle.mid"
    var sound5="MSboomb oom.mid"
    var sound6="MSladyi nred.mid"
    var sound7="MSstrok in.mid"
    var sound8="MSmambo 5.mid"
    var sound9="MSoyoco mova.mid"
    var sound10="MSswee thomechicago.mi d"
    var sound11="MSlove intheair.mid"
    var sound12="MSilov enightlife2.mid "
    var sound13="MScele bration.mid"
    var sound14="MSkiss uallover.mid"
    var x=Math.round(Ma th.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.appN ame=="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>



  • sheldonlg

    #2
    Re: Script won't work in IE

    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="javas cript" type="text/javascript">
    <!--
    //By George Chiang (http://www.wsabstract.com) More JavaScripts here!
    var sound1="MSymca. mid"
    var sound2="MSdisco inferno2.mid"
    var sound3="MSfunky town.mid"
    var sound4="MSthehu stle.mid"
    var sound5="MSboomb oom.mid"
    var sound6="MSladyi nred.mid"
    var sound7="MSstrok in.mid"
    var sound8="MSmambo 5.mid"
    var sound9="MSoyoco mova.mid"
    var sound10="MSswee thomechicago.mi d"
    var sound11="MSlove intheair.mid"
    var sound12="MSilov enightlife2.mid "
    var sound13="MScele bration.mid"
    var sound14="MSkiss uallover.mid"
    var x=Math.round(Ma th.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.appN ame=="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.m id", "MSdiscoinferno 2.mid", ....etc.);
    var y = Math.round(Math .random()*13);
    var x = sound[y];
    if ......

    Comment

    • mmurph211

      #3
      Re: Script won't work in IE

      On May 21, 11:03 pm, "Larry" <la...@westernl ifeinsurance.co mwrote:
      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="javas cript" type="text/javascript">
      <!--
      //By George Chiang (http://www.wsabstract.com) More JavaScripts here!
      var sound1="MSymca. mid"
      var sound2="MSdisco inferno2.mid"
      var sound3="MSfunky town.mid"
      var sound4="MSthehu stle.mid"
      var sound5="MSboomb oom.mid"
      var sound6="MSladyi nred.mid"
      var sound7="MSstrok in.mid"
      var sound8="MSmambo 5.mid"
      var sound9="MSoyoco mova.mid"
      var sound10="MSswee thomechicago.mi d"
      var sound11="MSlove intheair.mid"
      var sound12="MSilov enightlife2.mid "
      var sound13="MScele bration.mid"
      var sound14="MSkiss uallover.mid"
      var x=Math.round(Ma th.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.appN ame=="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.appN ame=="Microsoft Internet Explorer")
      I would use:
      if (/*@cc_on true || @*/false)
      Matt

      Comment

      • Erwin Moller

        #4
        Re: Script won't work in IE

        mmurph211 schreef:
        On May 21, 11:03 pm, "Larry" <la...@westernl ifeinsurance.co mwrote:
        >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="javas cript" type="text/javascript">
        ><!--
        >//By George Chiang (http://www.wsabstract.com) More JavaScripts here!
        >var sound1="MSymca. mid"
        >var sound2="MSdisco inferno2.mid"
        >var sound3="MSfunky town.mid"
        >var sound4="MSthehu stle.mid"
        >var sound5="MSboomb oom.mid"
        >var sound6="MSladyi nred.mid"
        >var sound7="MSstrok in.mid"
        >var sound8="MSmambo 5.mid"
        >var sound9="MSoyoco mova.mid"
        >var sound10="MSswee thomechicago.mi d"
        >var sound11="MSlove intheair.mid"
        >var sound12="MSilov enightlife2.mid "
        >var sound13="MScele bration.mid"
        >var sound14="MSkiss uallover.mid"
        >var x=Math.round(Ma th.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.appN ame=="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.appN ame=="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 incomprehensibl e. ;-)

        For more non-discussion on the subject:


        Regards,
        Erwin Moller
        >
        Matt

        Comment

        • Larry

          #5
          Re: Script won't work in IE

          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...@westernl ifeinsurance.co mwrote:
          | | | 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="javas cript" type="text/javascript">
          | | | <!--
          | | | //By George Chiang (http://www.wsabstract.com) More JavaScripts
          | | | here!
          | | | var sound1="MSymca. mid"
          | | | var sound2="MSdisco inferno2.mid"
          | | | var sound3="MSfunky town.mid"
          | | | var sound4="MSthehu stle.mid"
          | | | var sound5="MSboomb oom.mid"
          | | | var sound6="MSladyi nred.mid"
          | | | var sound7="MSstrok in.mid"
          | | | var sound8="MSmambo 5.mid"
          | | | var sound9="MSoyoco mova.mid"
          | | | var sound10="MSswee thomechicago.mi d"
          | | | var sound11="MSlove intheair.mid"
          | | | var sound12="MSilov enightlife2.mid "
          | | | var sound13="MScele bration.mid"
          | | | var sound14="MSkiss uallover.mid"
          | | | var x=Math.round(Ma th.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.appN ame=="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.appN ame=="Microsoft Internet Explorer")
          | |
          | | I would use:
          | | | if (/*@cc_on true || @*/false)
          | |
          | | Matt


          Comment

          • david.karr

            #6
            Re: Script won't work in IE

            On May 21, 8:03 pm, "Larry" <la...@westernl ifeinsurance.co mwrote:
            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.appN ame=="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.

            Comment

            • Larry

              #7
              Re: Script won't work in IE

              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...@westernl ifeinsurance.co mwrote:
              | | | 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.appN ame=="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.


              Comment

              • Larry

                #8
                Re: Script won't work in IE

                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="javas cript" type="text/javascript">
                | <!--
                | //By George Chiang (http://www.wsabstract.com) More JavaScripts here!
                | var sound1="MSymca. mid"
                | var sound2="MSdisco inferno2.mid"
                | var sound3="MSfunky town.mid"
                | var sound4="MSthehu stle.mid"
                | var sound5="MSboomb oom.mid"
                | var sound6="MSladyi nred.mid"
                | var sound7="MSstrok in.mid"
                | var sound8="MSmambo 5.mid"
                | var sound9="MSoyoco mova.mid"
                | var sound10="MSswee thomechicago.mi d"
                | var sound11="MSlove intheair.mid"
                | var sound12="MSilov enightlife2.mid "
                | var sound13="MScele bration.mid"
                | var sound14="MSkiss uallover.mid"
                | var x=Math.round(Ma th.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.appN ame=="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>

                Comment

                Working...