Click to See Complete Forum and Search --> : IE's Unwanted refesh when Div tag change


McShaman
03-10-2003, 09:02 PM
Could somebody please help me with this problem?
I have set up this html page so that when I click on a link it will ad extra information into an empty div tag... the only problem is that when I click on the link IE adds the information to the page but then it returns to the top of the screen...
Is it possible to disable this irritating habit from IE?

Thanks for your help

AdamBrill
03-10-2003, 09:09 PM
It shouldn't be doing that... Try posting your code and I'll take a look. :)

McShaman
03-12-2003, 05:26 PM
Here is the basic structure of my code... I hope this enough to solve the problem.

<html>
<head>
<title></title>
<script language="JavaScript" src="javascript.js"></script>
<script language="JavaScript">
function chngtxt(message) {
if (message == 0) {
document.all.textdiv0.innerHTML = table_pt1 + "Title" + table_pt2 + "0" + table_pt3 + "Body Text" + table_pt4
}
}
</script>
</head>
<body>
<a href="#" onClick="chngtxt(0)">Click here to add text</a>
<div id='textdiv0'></div>
</body>
</html>

AdamBrill
03-12-2003, 05:37 PM
Change this line:

<a href="#" onClick="chngtxt(0)">Click here to add text</a>

to this:

<a href="#" onClick="chngtxt(0); return false;">Click here to add text</a>

Then it should work. ;)