By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,299 Members | 1,347 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,299 IT Pros & Developers. It's quick & easy.

Java script works only on Fire Fox

matheussousuke
100+
P: 249
I have a script that works on FF but doesn't in IE.

Hare
Expand|Select|Wrap|Line Numbers
  1.  
  2. <html>
  3. <head>
  4.  
  5.  
  6.   <STYLE>
  7.    A.link:link {color: black; text-decoration: none}
  8.    A.link:visited {color: black; text-decoration: none}
  9.    A.link:active {color: black; text-decoration: none} 
  10.    A.link:hover {color: black; text-decoration : none;}
  11.   </STYLE>
  12.   <script language="JavaScript1.2">
  13.    var ie=document.all
  14.    var dom=document.getElementById
  15.    var ns4=document.layers
  16.  
  17.    var bouncelimit=32 //(must be divisible by 8)
  18.    var direction="up"
  19.  
  20.    function initbox(){
  21.     if (!dom&&!ie&&!ns4)
  22.     return
  23.     crossobj=(dom)?document.getElementById("dropin").style : ie? document.all.dropin : document.dropin
  24.     scroll_top=(ie)? document.body.scrollTop : window.pageYOffset
  25.     crossobj.top=scroll_top-400 //Tempo de entrada
  26.     crossobj.visibility=(dom||ie)? "visible" : "show"
  27.     dropstart=setInterval("dropin()",10) //Velocidade de entrada
  28.    }
  29.    function dropin(){
  30.     scroll_top=(ie)? document.body.scrollTop : window.pageYOffset
  31.     if (parseInt(crossobj.top)<15+scroll_top)
  32.     crossobj.top=parseInt(crossobj.top)+15
  33.     else{
  34.      clearInterval(dropstart)
  35.      bouncestart=setInterval("bouncein()",50)
  36.     }
  37.    }
  38.    function bouncein(){
  39.     crossobj.top=parseInt(crossobj.top)-bouncelimit
  40.     if (bouncelimit<0)
  41.     bouncelimit+=8
  42.     bouncelimit=bouncelimit*-1
  43.     if (bouncelimit==0){
  44.      clearInterval(bouncestart)
  45.     }
  46.    }
  47.    function dismissbox(){
  48.     if (window.bouncestart) clearInterval(bouncestart)
  49.     crossobj.visibility="hidden"
  50.    }
  51.    function get_cookie(Name) {
  52.     var search = Name + "="
  53.     var returnvalue = ""
  54.     if (document.cookie.length > 0) {
  55.      offset = document.cookie.indexOf(search)
  56.      if (offset != -1) {
  57.       offset += search.length
  58.       end = document.cookie.indexOf(";", offset)
  59.       if (end == -1)
  60.       end = document.cookie.length;
  61.       returnvalue=unescape(document.cookie.substring(offset, end))
  62.      }
  63.     }
  64.     return returnvalue;
  65.    }
  66.    function dropornot(){
  67.     if (get_cookie("droppedin")==""){
  68.      window.onload=initbox
  69.      document.cookie="droppedin=yes"
  70.     }
  71.    }
  72.    dropornot()
  73.    function redo(){
  74.     bouncelimit=32
  75.     direction="up"
  76.     initbox()
  77.    }
  78.    window.onload=initbox
  79.   </script>
  80.   <script src="../../Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
  81. </head>
  82.  
  83.  
  84.  
  85.  
  86.     <link rel="stylesheet" href="style.css" type="text/css">
  87. </head>
  88. <body>
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  <div id="dropin" style="position:absolute;visibility:hidden;left:200;top:0;width:600;height:400;background-color:#F5F5F5">
  96.    <TABLE WIDTH="100%" HEIGHT="100%" BORDER="1" CELLPADDING="0" CELLSPACING="0" BORDERCOLOR="#000000">
  97.     <TR>
  98.      <TD valign="top"><div align="right"><a class="link" href="javascript:dismissbox()"><FONT FACE="Verdana" SIZE="-2"><B>X</B></FONT></a>&nbsp;</div>
  99.        <script type="text/javascript">
  100. 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
  101. </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">
  102.          <param name="movie" value="mcbanner.swf">
  103.          <param name="quality" value="high">
  104.          <embed src="mcbanner.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="600" height="400"></embed>
  105.       </object></noscript>
  106.  
  107.  
  108.  
  109.  



Youcan see the website on this link http://mistercurriculos.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.
Feb 4 '10 #1
Share this Question
Share on Google+
13 Replies


acoder
Expert Mod 15k+
P: 16,027
What doesn't work in IE?
Feb 4 '10 #2

matheussousuke
100+
P: 249
The script above, it only opens on FF.
Feb 4 '10 #3

Plater
Expert 5K+
P: 7,872
What does IE say for an error? They're not usually helpful, but it might be a place to start
Feb 4 '10 #4

matheussousuke
100+
P: 249
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

www.mistercurriculos.com.br
Feb 4 '10 #5

matheussousuke
100+
P: 249
Somebody help me, plix, that's for a costumer.
Feb 4 '10 #6

Plater
Expert 5K+
P: 7,872
Hmm well lets see
<script language="JavaScript1.2"> you really should have the type="text/javascript" atribute I think.

What version of IE didn't support document.getElementById() ? 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?
Feb 4 '10 #7

matheussousuke
100+
P: 249
Well, that works on IE here, but only in local server. I have the IE version that comes with Windows XP SP2
Feb 4 '10 #8

matheussousuke
100+
P: 249
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?
Feb 4 '10 #9

Plater
Expert 5K+
P: 7,872
Anywhere you want in you code, put
alert("I am at _______");

and fill in the blank with a location
Feb 4 '10 #10

matheussousuke
100+
P: 249
It doesn't works. And that's funny, now cant see the pop not enve in Fire Fox, just can hear the flash sound.
Feb 5 '10 #11

matheussousuke
100+
P: 249
I found it out, the trouble is because this script that is right under the one I posted here

Expand|Select|Wrap|Line Numbers
  1.     <script language="JavaScript1.2">
  2.  
  3. var it=0
  4. function initialize(){
  5. mytext=typing.innerText
  6. var myheight=typing.offsetHeight
  7. typing.innerText=''
  8. document.all.typing.style.height=myheight
  9. document.all.typing.style.visibility="visible"
  10. typeit()
  11. }
  12. function typeit(){
  13. typing.insertAdjacentText("beforeEnd",mytext.charAt(it))
  14. if (it<mytext.length-1){
  15. it++
  16. setTimeout("typeit()",100)
  17. }
  18. else
  19. return
  20. }
  21. if (document.all)
  22. document.body.onload=initialize
  23.  
  24. </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?
Feb 5 '10 #12

matheussousuke
100+
P: 249
One script prevents other of working.


Does anybody know why that happen?
Feb 5 '10 #13

matheussousuke
100+
P: 249
I'm affraid I'll have to relive this topic.

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

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2.  
  3. var it=0
  4. function initialize(){
  5. mytext=typing.innerText
  6. var myheight=typing.offsetHeight
  7. typing.innerText=''
  8. document.all.typing.style.height=myheight
  9. document.all.typing.style.visibility="visible"
  10. typeit()
  11. }
  12. function typeit(){
  13. typing.insertAdjacentText("beforeEnd",mytext.charAt(it))
  14. if (it<mytext.length-1){
  15. it++
  16. setTimeout("typeit()",100)
  17. }
  18. else
  19. return
  20. }
  21. if (document.all)
  22. document.body.onload=initialize
  23.  
  24. </script>
  25.  
  26. <span id="typing" style="visibility:hidden" align="left"><?=$st?></span>
  27.     <br>
  28. <?
  29. }
  30. ?>
  31. <br><br><a class=TN href=story.php> <?=$STORY2?></a>
  32.  


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

I changed the attribute
Expand|Select|Wrap|Line Numbers
  1. style="visibility:hidden"
to
Expand|Select|Wrap|Line Numbers
  1. style="visibility:inherit"
The text show up, but it won't show the js typing effect.
Oct 6 '11 #14

Post your reply

Sign in to post your reply or Sign up for a free account.