Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Another Browser Differences Problem

Status
Not open for further replies.

theEclipse

Programmer
Dec 27, 1999
1,190
US
I have a dhtml script that I have been sweating over for a long time, and finally got it to work, in ie5.0. Then, I tried to run it in Netscape 4.7. It ended up crashing the browser. With just one illegal operation, error msg: NETSCAPE caused an invalid page fault in module JS3240.DLL at 015f:6002e3f8, with that illegal operaton, tragically, my browser session ended.:-(<br>
<br>
If you own IE5.0, check it out, at <A HREF=" TARGET="_new"> , If you have any netscape version, I wouldn't suggest it.<br>
<br>
source code:<br>
<br>
<i>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;&gt;<br>
&lt;HTML&gt;<br>
&lt;HEAD&gt;<br>
&lt;TITLE&gt;&lt;/TITLE&gt;<br>
&lt;script language=&quot;javascript&quot;&gt;<br>
if (document.layers){alert('this page is not netscape friendly'); location='<A HREF=" TARGET="_new"><br>
var numsteps=135,timer<br>
<br>
function constructor(div,endx,endy){<br>
this.all=(document.all)?document.all[div].style:(document.layers)?document.layers[div]:null;<br>
this.visibility=this.all.visibility;<br>
this.calcStep=calculateNumSteps;<br>
this.stepMover=moveItWithSteps;<br>
this.randTL=makeTLrandom;<br>
this.step=new xyObj(0,0)<br>
this.end=new xyObj(endx,endy);<br>
this.steps=numsteps;<br>
this.i=0<br>
this.objct=div+ &quot;Object&quot;;<br>
eval(this.objct+&quot;=this&quot;);<br>
return this<br>
}<br>
<br>
function xyObj(x,y){<br>
this.x=x<br>
this.y=y<br>
return this<br>
}<br>
<br>
function startItUp(){<br>
pntMon=new constructor('PlanetAndMoon',550,15);<br>
mnBody=new constructor('mainBody',150,35);<br>
startAllMove();<br>
}<br>
<br>
var moveLyrs='pntMon mnBody'<br>
<br>
function startAllMove(){<br>
var constr=moveLyrs.split(' ')<br>
for (i=0;i&lt;constr.length;i++){<br>
eval(constr<i>+'.randTL()');<br>
eval(constr<i>+'.calcStep()');<br>
eval(constr<i>+'.stepMover()');<br>
}}<br>
<br>
function makeTLrandom(){<br>
posNeg=Math.round(Math.random()*-1)<br>
if (posNeg==0){posNeg=1}<br>
this.all.top=Math.random()*1000+100*posNeg;<br>
this.all.left=Math.random()*1000+100*posNeg;}<br>
<br>
function moveItWithSteps(){<br>
if (this.i&lt;=this.steps){<br>
this.all.left=this.all.pixelLeft+parseInt((this.end.x-this.all.pixelLeft)*.1)<br>
this.all.top=this.all.pixelTop+parseInt((this.end.y-this.all.pixelTop)*.1);<br>
timer=setTimeout(this.objct+'.stepMover()',50)<br>
this.i++}}<br>
<br>
function calculateNumSteps(){<br>
this.step.x=(this.end.x-parseInt(this.all.left))/this.steps;<br>
this.step.y=(this.end.y-parseInt(this.all.top))/this.steps;<br>
return this}<br>
<br>
&lt;/script&gt;<br>
&lt;style&gt;<br>
#mainBody {border:solid 1px red; width:350; overflow:hidden;}<br>
.mvaBle {position:absolute; top:-240; left:-240; visibility:visible;}<br>
body {color:#000000;}<br>
&lt;/style&gt;<br>
&lt;/HEAD&gt;<br>
&lt;body onload=&quot;startItUp()&quot; background=&quot;images/background.gif&quot; id=bodynosel scroll=no text=#000000 bgproperties=fixed&gt;<br>
&lt;div id=mainBody class=mvaBle style=&quot;top:35; left:150;&quot;&gt;<br>
<br>
blah blah blah blah blah blah blah blah &lt;br&gt;blah blah blah blah blah blah blah blah &lt;br&gt;<br>
blah blah blah blah blah blah blah blah &lt;br&gt;blah blah blah blah blah blah blah blah &lt;br&gt;<br>
blah blah blah blah blah blah blah blah &lt;br&gt;blah blah blah blah blah blah blah blah &lt;br&gt;<br>
<br>
blah blah blah blah blah blah blah blah &lt;br&gt;blah blah blah blah blah blah blah blah &lt;br&gt;<br>
blah blah blah blah blah blah blah blah &lt;br&gt;blah blah blah blah blah blah blah blah &lt;br&gt;<br>
blah blah blah blah blah blah blah blah &lt;br&gt;blah blah blah blah blah blah blah blah &lt;br&gt;<br>
<br>
&lt;/div&gt;<br>
&lt;div id=PlanetAndMoon class=mvaBle&gt;PlanetImageHERE&lt;/div&gt;<br>
&lt;/BODY&gt;<br>
&lt;/HTML&gt;<br>
</i><br>
<br>
I think the problem lies in my constructor function, but still not sure.<br>
<br>
Thanks in advance,<br>
<p>theEclipse<br><a href=mailto: > </a><br><a href=robacarp.webjump.com>robacarp.webjump.com</a><br>
 
Whoops, I forgot something:<br>
<br>
the step calculator function is of no use right now, the variables it sets are not used anymore.<br>
<br>
variables no longer needed are: this.steps, this.step.x, this.step.y<br>
<br>
just thought you might like to know, <p>theEclipse<br><a href=mailto: > </a><br><a href=robacarp.webjump.com>robacarp.webjump.com</a><br>
 
One thing, don't force them out, instead give them a choice of either staying and possibly facing the consequences or going. The other problem is that your problem is within Windows, not other OS's, so something that asks the person if they can stay would be better. I also believe that Mozilla also returns as being a Netscape browser, but I'm not totally sure. <p>REH<br><a href=mailto:hawkdogg@crosswinds.net>hawkdogg@crosswinds.net</a><br><a href= by Linux</a><br>Learn Linux and Leave out the Windows :)
 
Also...you're forcing out people who may be using browsers that allow both document.all and document.layers objects....in which case the document.all approach would still be fully useable for you.<br>
When you tested it on NetScape....did you try re-booting your computer; then attempting to open the page again? <p>-Robherc<br><a href=mailto:robherc@netzero.net>robherc@netzero.net</a><br><a href= shared.freeservers.com/searchmaster.html>SearchMaster Interface...11-in-1</a><br>Wanting to learn Assembler; please e-mail me any tutorials or links for it that are useful to you :)
 
You are both right about the browser document.layers thing. will change, upload. About the mozilla thing tho - I tried it on mozilla, and got the same results as netscape. <p>theEclipse<br><a href=mailto: > </a><br><a href=robacarp.webjump.com>robacarp.webjump.com</a><br>
 
I got basically the same thing on MY Web!!!<br><br>IE5 works fine, but as soon as I try to use netscape 4.73, it blows on the JS3240.DLL<br>Page fault.... I havn't been able to find much... Microsoft acknowledges the problem<br>with something about &quot;3td party software&quot;. I am running Windows 98, Front Page 2000, and Navigator 4.73.... Also there are postings about the Submit to Email<br>not working consistantly out here... yep I have that problem too!!! Currently I am<br>considering Buying &quot;EasyWeb&quot;... Anybody got any suggestions??? email me at <A HREF="mailto:scorav@execpc.com">scorav@execpc.com</A> - I would appriciate it!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top