theEclipse
Programmer
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><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><br>
<HTML><br>
<HEAD><br>
<TITLE></TITLE><br>
<script language="javascript"><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].styledocument.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+ "Object";<br>
eval(this.objct+"=this"<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<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<=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>
</script><br>
<style><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>
</style><br>
</HEAD><br>
<body onload="startItUp()" background="images/background.gif" id=bodynosel scroll=no text=#000000 bgproperties=fixed><br>
<div id=mainBody class=mvaBle style="top:35; left:150;"><br>
<br>
blah blah blah blah blah blah blah blah <br>blah blah blah blah blah blah blah blah <br><br>
blah blah blah blah blah blah blah blah <br>blah blah blah blah blah blah blah blah <br><br>
blah blah blah blah blah blah blah blah <br>blah blah blah blah blah blah blah blah <br><br>
<br>
blah blah blah blah blah blah blah blah <br>blah blah blah blah blah blah blah blah <br><br>
blah blah blah blah blah blah blah blah <br>blah blah blah blah blah blah blah blah <br><br>
blah blah blah blah blah blah blah blah <br>blah blah blah blah blah blah blah blah <br><br>
<br>
</div><br>
<div id=PlanetAndMoon class=mvaBle>PlanetImageHERE</div><br>
</BODY><br>
</HTML><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>
<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><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><br>
<HTML><br>
<HEAD><br>
<TITLE></TITLE><br>
<script language="javascript"><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].styledocument.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+ "Object";<br>
eval(this.objct+"=this"<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<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<=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>
</script><br>
<style><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>
</style><br>
</HEAD><br>
<body onload="startItUp()" background="images/background.gif" id=bodynosel scroll=no text=#000000 bgproperties=fixed><br>
<div id=mainBody class=mvaBle style="top:35; left:150;"><br>
<br>
blah blah blah blah blah blah blah blah <br>blah blah blah blah blah blah blah blah <br><br>
blah blah blah blah blah blah blah blah <br>blah blah blah blah blah blah blah blah <br><br>
blah blah blah blah blah blah blah blah <br>blah blah blah blah blah blah blah blah <br><br>
<br>
blah blah blah blah blah blah blah blah <br>blah blah blah blah blah blah blah blah <br><br>
blah blah blah blah blah blah blah blah <br>blah blah blah blah blah blah blah blah <br><br>
blah blah blah blah blah blah blah blah <br>blah blah blah blah blah blah blah blah <br><br>
<br>
</div><br>
<div id=PlanetAndMoon class=mvaBle>PlanetImageHERE</div><br>
</BODY><br>
</HTML><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>