Hi,
The following code snippet works on page load (it displays an anchor link using document.write) , works when the anchor is clicked on the first time, but does not work when the anchor link is clicked on subsequently:
I get the error "object expected" with the following in the left side of the debug screen when the link is clicked on a second time:
Does anybody know why this code does not work properly when the anchor link is clicked on a second time?
Any help would be greatly appreciated.. The server is IIS 5.1 under Win XP SP3. The client browser is IE8.
Thanks,
Dave
---------------------------------------------------
The following code snippet works on page load (it displays an anchor link using document.write) , works when the anchor is clicked on the first time, but does not work when the anchor link is clicked on subsequently:
I get the error "object expected" with the following in the left side of the debug screen when the link is clicked on a second time:
Code:
<A href="javascript:void(0)" onclick="MyFunc()">Press Here</A>
Any help would be greatly appreciated.. The server is IIS 5.1 under Win XP SP3. The client browser is IE8.
Thanks,
Dave
---------------------------------------------------
Code:
<HTML>
<BODY>
<SCRIPT>
RedrawScreen()
function RedrawScreen() {
alert("in the draw screen function")
document.write("<A href=javascript:void(0) onclick=MyFunc()>Press Here</A>")
}
function MyFunc() {
alert("in the function")
RedrawScreen()
}
</SCRIPT>
</BODY>
</HTML>
Comment