Java script works only on Fire Fox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • matheussousuke
    New Member
    • Sep 2009
    • 249

    Java script works only on Fire Fox

    I have a script that works on FF but doesn't in IE.

    Hare
    Code:
    <html>
    <head>
    
    
      <STYLE>
       A.link:link {color: black; text-decoration: none}
       A.link:visited {color: black; text-decoration: none}
       A.link:active {color: black; text-decoration: none} 
       A.link:hover {color: black; text-decoration : none;}
      </STYLE>
      <script language="JavaScript1.2">
       var ie=document.all
       var dom=document.getElementById
       var ns4=document.layers
    
       var bouncelimit=32 //(must be divisible by 8)
       var direction="up"
    
       function initbox(){
        if (!dom&&!ie&&!ns4)
        return
        crossobj=(dom)?document.getElementById("dropin").style : ie? document.all.dropin : document.dropin
        scroll_top=(ie)? document.body.scrollTop : window.pageYOffset
        crossobj.top=scroll_top-400 //Tempo de entrada
        crossobj.visibility=(dom||ie)? "visible" : "show"
        dropstart=setInterval("dropin()",10) //Velocidade de entrada
       }
       function dropin(){
        scroll_top=(ie)? document.body.scrollTop : window.pageYOffset
        if (parseInt(crossobj.top)<15+scroll_top)
        crossobj.top=parseInt(crossobj.top)+15
        else{
         clearInterval(dropstart)
         bouncestart=setInterval("bouncein()",50)
        }
       }
       function bouncein(){
        crossobj.top=parseInt(crossobj.top)-bouncelimit
        if (bouncelimit<0)
        bouncelimit+=8
        bouncelimit=bouncelimit*-1
        if (bouncelimit==0){
         clearInterval(bouncestart)
        }
       }
       function dismissbox(){
        if (window.bouncestart) clearInterval(bouncestart)
        crossobj.visibility="hidden"
       }
       function get_cookie(Name) {
        var search = Name + "="
        var returnvalue = ""
        if (document.cookie.length > 0) {
         offset = document.cookie.indexOf(search)
         if (offset != -1) {
          offset += search.length
          end = document.cookie.indexOf(";", offset)
          if (end == -1)
          end = document.cookie.length;
          returnvalue=unescape(document.cookie.substring(offset, end))
         }
        }
        return returnvalue;
       }
       function dropornot(){
        if (get_cookie("droppedin")==""){
         window.onload=initbox
         document.cookie="droppedin=yes"
        }
       }
       dropornot()
       function redo(){
        bouncelimit=32
        direction="up"
        initbox()
       }
       window.onload=initbox
      </script>
      <script src="../../Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
    </head>
    
    	
    	
    	
    	<link rel="stylesheet" href="style.css" type="text/css">
    </head>
    <body>
    
    
    
    
    
    
     <div id="dropin" style="position:absolute;visibility:hidden;left:200;top:0;width:600;height:400;background-color:#F5F5F5">
       <TABLE WIDTH="100%" HEIGHT="100%" BORDER="1" CELLPADDING="0" CELLSPACING="0" BORDERCOLOR="#000000">
        <TR>
         <TD valign="top"><div align="right"><a class="link" href="javascript:dismissbox()"><FONT FACE="Verdana" SIZE="-2"><B>X</B></FONT></a>&nbsp;</div>
           <script type="text/javascript">
    AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0','width','600','height','400','title','MCbanner','src','mcbanner','quality','high','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','mcbanner' ); //end AC code
    </script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="600" height="400" title="MCbanner">
             <param name="movie" value="mcbanner.swf">
             <param name="quality" value="high">
             <embed src="mcbanner.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="600" height="400"></embed>
          </object></noscript>



    Youcan see the website on this link http://mistercurriculo s.com.br/





    One more thing, why the flash keeps playing after I close the window?
    If you close the window before the flash sound came, u will hear the sound from flash even with the window closed.
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    What doesn't work in IE?

    Comment

    • matheussousuke
      New Member
      • Sep 2009
      • 249

      #3
      The script above, it only opens on FF.

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        What does IE say for an error? They're not usually helpful, but it might be a place to start

        Comment

        • matheussousuke
          New Member
          • Sep 2009
          • 249

          #5
          It doesn't say nothing, the window just doesn't open, even if u unblock popups, Try to open it with FF, u will make it, now try to open it with IE.

          here

          Comment

          • matheussousuke
            New Member
            • Sep 2009
            • 249

            #6
            Somebody help me, plix, that's for a costumer.

            Comment

            • Plater
              Recognized Expert Expert
              • Apr 2007
              • 7872

              #7
              Hmm well lets see
              <script language="JavaS cript1.2"> you really should have the type="text/javascript" atribute I think.

              What version of IE didn't support document.getEle mentById() ? IE6 and newer certainly do.

              Have you tried putting alerts after every piece of code so that you can follow where it is and where it stops working?

              Comment

              • matheussousuke
                New Member
                • Sep 2009
                • 249

                #8
                Well, that works on IE here, but only in local server. I have the IE version that comes with Windows XP SP2

                Comment

                • matheussousuke
                  New Member
                  • Sep 2009
                  • 249

                  #9
                  Have you tried putting alerts after every piece of code so that you can follow where it is and where it stops working?
                  So, how do I do that?

                  Comment

                  • Plater
                    Recognized Expert Expert
                    • Apr 2007
                    • 7872

                    #10
                    Anywhere you want in you code, put
                    alert("I am at _______");

                    and fill in the blank with a location

                    Comment

                    • matheussousuke
                      New Member
                      • Sep 2009
                      • 249

                      #11
                      It doesn't works. And that's funny, now cant see the pop not enve in Fire Fox, just can hear the flash sound.

                      Comment

                      • matheussousuke
                        New Member
                        • Sep 2009
                        • 249

                        #12
                        I found it out, the trouble is because this script that is right under the one I posted here

                        Code:
                        	<script language="JavaScript1.2">
                        
                        var it=0
                        function initialize(){
                        mytext=typing.innerText
                        var myheight=typing.offsetHeight
                        typing.innerText=''
                        document.all.typing.style.height=myheight
                        document.all.typing.style.visibility="visible"
                        typeit()
                        }
                        function typeit(){
                        typing.insertAdjacentText("beforeEnd",mytext.charAt(it))
                        if (it<mytext.length-1){
                        it++
                        setTimeout("typeit()",100)
                        }
                        else
                        return
                        }
                        if (document.all)
                        document.body.onload=initialize
                        
                        </script>

                        Looks like there are some elements similar to the other one, but I don't know how to change.
                        How do I do that?

                        Comment

                        • matheussousuke
                          New Member
                          • Sep 2009
                          • 249

                          #13
                          One script prevents other of working.


                          Does anybody know why that happen?

                          Comment

                          • matheussousuke
                            New Member
                            • Sep 2009
                            • 249

                            #14
                            I'm affraid I'll have to relive this topic.

                            Had to go back to this script, but now I understand a little more.

                            Code:
                            <script type="text/javascript">
                            
                            var it=0
                            function initialize(){
                            mytext=typing.innerText
                            var myheight=typing.offsetHeight
                            typing.innerText=''
                            document.all.typing.style.height=myheight
                            document.all.typing.style.visibility="visible"
                            typeit()
                            }
                            function typeit(){
                            typing.insertAdjacentText("beforeEnd",mytext.charAt(it))
                            if (it<mytext.length-1){
                            it++
                            setTimeout("typeit()",100)
                            }
                            else
                            return
                            }
                            if (document.all)
                            document.body.onload=initialize
                            
                            </script>
                            
                            <span id="typing" style="visibility:hidden" align="left"><?=$st?></span>
                            	<br>
                            <?
                            }
                            ?>
                            <br><br><a class=TN href=story.php> <?=$STORY2?></a>


                            It now works with IE8, but not with Fire Fox and Chrome.

                            I changed the attribute
                            Code:
                            style="visibility:hidden"
                            to
                            Code:
                            style="visibility:inherit"
                            The text show up, but it won't show the js typing effect.

                            Comment

                            Working...