473,385 Members | 1,769 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,385 software developers and data experts.

Java script works only on Fire Fox

matheussousuke
249 100+
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
13 2717
acoder
16,027 Expert Mod 8TB
What doesn't work in IE?
Feb 4 '10 #2
matheussousuke
249 100+
The script above, it only opens on FF.
Feb 4 '10 #3
Plater
7,872 Expert 4TB
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
249 100+
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
249 100+
Somebody help me, plix, that's for a costumer.
Feb 4 '10 #6
Plater
7,872 Expert 4TB
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
249 100+
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
249 100+
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
7,872 Expert 4TB
Anywhere you want in you code, put
alert("I am at _______");

and fill in the blank with a location
Feb 4 '10 #10
matheussousuke
249 100+
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
249 100+
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
249 100+
One script prevents other of working.


Does anybody know why that happen?
Feb 5 '10 #13
matheussousuke
249 100+
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

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

Similar topics

3
by: Raju V.K | last post by:
can I use javascript and PHP in the following manner to create a pop-up window: <--- in <head> </head> <script language=javascript> function popup(folder1, file1) {...
1
by: Jens Mueller | last post by:
Hi there, this is a Java-XML Question, so I am not sure whether this is the right place, haven't found anything better .... I try to convert a Java object to XML via SAX and let the FOP...
5
by: Mark Szlazak | last post by:
Apparently there is a textarea onscroll event bubbling bug in Firefox and Mozilla: https://bugzilla.mozilla.org/show_bug.cgi?id=229089 I'm trying to check for this bug with the following...
3
by: Razvan | last post by:
Hello, Can somebody recommend me a Java Script scroller that can scroll an i-frame ? I tried the Tigra scroller (www.softcomplex.com/products/tigra_scroller/) but sometimes it does not...
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
15
by: webstormcomputers | last post by:
I'm trying to update a hidden field with java script and I'm only getting one of the values from my select stament. Here is the code below. <select name="on0"> <option value="25">25 <option...
5
by: IndependentDreams | last post by:
This is a java script code that will make it snow on your page. My problem is that it works just fine in IE and Opera, but doesn't work in Fire Fox or Safari. Here is the code. If you have any idea...
1
by: houh | last post by:
I have a java app that generates openoffice docs. When I run the java app in a shell script, as: export JAVA_HOME=/opt/corp/projects/metrics/Java/jdk1.5.0_07/bin/java export...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.