IE5 Fix

The Following Works In IE4 And NS4,
But Not IE5. Please Help Me Fix It.

<HTML><HEAD><META HTTP-EQUIV="Pragma" CONTENT="no=cache">
</HEAD>
<FRAMESET ROWS="*,0" border=0>
   <FRAME border=0 SRC="blank.htm" NAME="main">
   <FRAME border=0 SRC="js.htm" NAME="hidden">
</FRAMESET>
</FRAMESET>
</HTML>

js.htm:
<HTML><HEAD><META HTTP-EQUIV="Pragma" CONTENT="no=cache"></HEAD>
<script>
i=0;
if (navigator.appName == "Netscape") {nav = "NS"} else{nav = "IE";}
function on_load() {
self.parent.main.document.close();
self.parent.main.document.open();
self.parent.main.document.write("<html><body bgcolor='#906000'>");
writer();
}

function writer() {
self.parent.main.document.write("<a name='" + i + "'>" + i + "</a><br>");
if (nav == "NS"){self.parent.main.scrollTo(self.parent.main.document.anchors[i].x,self.parent.main.document.anchors[i].y);}
else {self.parent.main.document.anchors[i].focus();}
i++;
setTimeout("writer();", 1000);
}
</script>
<body onLoad="on_load(0)"></body></html>


rejsAsked:
Who is Participating?
 
Michel PlungjanConnect With a Mentor IT ExpertCommented:
Thanks ;-)

self.parent.main.document.anchors[i].scrollIntoView();

will work in IE4+

Michel
0
 
xavCommented:
It seems to work fine for me in IE5.  It loads the 2 frames, and writes 1,2,3, and so on (in anchors) in the main frame every second.  Is that what it's supposed to do?  What error (if any) are you getting?
0
 
Michel PlungjanIT ExpertCommented:
You migth want to use
self.parent.main.document.anchors[i].scrollIntoView();

instead of focus()

Michel
0
 
rejsAuthor Commented:
Sorry xav,
Its Supposed To Scroll To The Botton Each Time.

mplungjan,
Your Andswer Worked For IE5
If You Have IE4 Runable Seperate From IE5, Please Check It For Me.
Submit Your Results As The Answer.
Easy 500 :)
rejs
0
All Courses

From novice to tech pro — start learning today.