JavaScript code works fine in IE but could not support mozilla, chrome

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Unkno
    New Member
    • Mar 2013
    • 9

    JavaScript code works fine in IE but could not support mozilla, chrome

    I have done this code in shrepoint 2013 script editor it does not support in mozilla ,chrome etc but it worka fine in IE.. PLEASE GIVE ME SOLUTION FOR THIS IMMEDIATELY


    Code:
    <html> <head> <SCRIPT type="text/JavaScript"> 
    
    var scroller_msg='Hello guys!!!!!!!'
    var dismissafter=0
    
    var initialvisible=0
    
    if (document.all)
    document.write('<marquee id="curscroll" style="position:absolute;
    width:90px;border:1px dotted silver; 
    font-family:Tahoma;font-size:15px ;background-color:#EDF09C ;
    visibility:True">'+scroller_msg+'</marquee>')
    
    
    </script> </head> <body> </body> </html>
    Last edited by Rabbit; Mar 6 '13, 04:29 PM. Reason: Please use code tags when posting code.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Please use code tags when posting code. And please do not DEMAND SOLUTIONS IMMEDIATELY.

    The marquee element is not valid HTML and is supported only by IE. You will have to mimic the effect of a marquee on other browsers by using javascript.

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #3
      Your biggest issue is your use of document.all.

      PS. moved to JavaScript.

      Comment

      • Unkno
        New Member
        • Mar 2013
        • 9

        #4
        Now the code works fine... thankx for ur reply :)

        Comment

        • acoder
          Recognized Expert MVP
          • Nov 2006
          • 16032

          #5
          Could you post the final working solution for the benefit of others?

          Comment

          • simum
            New Member
            • Mar 2013
            • 4

            #6
            Code:
            <html>
            <head>
            <SCRIPT type="text/JavaScript"> 
            var scroller_msg='Hello guys!!!!!!!'
            document.write('<marquee id="curscroll" style="position:absolute;width:90px;border:1.5px dotted silver; font-family:Tahoma;font-size:15px ;background-color:#ECB66B ;visibility:True">'+scroller_msg+'</marquee>')
            
            </script>
            </head>
            <body>
            </body>
            </html>
            This is the code that works fine in all browsers :)
            Last edited by acoder; Mar 11 '13, 10:53 AM. Reason: Please use [code] tags when posting code

            Comment

            • Unkno
              New Member
              • Mar 2013
              • 9

              #7
              Code:
              <html>
               <head>
               <SCRIPT type="text/JavaScript"> 
              var scroller_msg='Hello guys!!!!!!!'
               document.write('<marquee id="curscroll" style="position:absolute;width:90px;border:1.5px dotted silver; font-family:Tahoma;font-size:15px ;background-color:#ECB66B ;visibility:True">'+scroller_msg+'</marquee>')
               
              </script>
               </head>
               <body>
               </body>
               </html>
              ya this code works fine :)
              Last edited by acoder; Mar 11 '13, 10:53 AM. Reason: Please use [code] tags when posting code

              Comment

              • acoder
                Recognized Expert MVP
                • Nov 2006
                • 16032

                #8
                Unless this happens to be the start of a larger program or simply a test, there doesn't seem to be any benefit in using JavaScript here. You could have just as easily used HTML only.

                Comment

                Working...