
Originally Posted by
gwen32540
Describe problem: The code below generates an "object expected" error.
No it doesn't:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
function load_content () {
if (parent.document.getElementById('main_div')) {
parent.document.getElementById('main_div').innerHTML=document.getElementById('inner_frame').innerHTML;
}
if (!parent.document.getElementById('main_div')) {
window.location=('faq.cfm') ;
}
}
</script>
</head>
<body>
<script type="text/javascript" language="JavaScript">
var linktext=new Array();
linktext[0]="Visit Dynamic Drive for some great DHTML scripts!";
linktext[1]="JavaScript Kit, the JavaScript technology center";
linktext[2]="Direct link to hundreds of free java applets online";
var ns6=document.getElementById&&!document.all
var ie=document.all
function show_text(thetext, whichdiv){
if (ie) eval("document.all."+whichdiv).innerHTML=linktext[thetext]
else if (ns6) document.getElementById(whichdiv).innerHTML=linktext[thetext]
}
function resetit(whichdiv){
if (ie) eval("document.all."+whichdiv).innerHTML=' '
else if (ns6) document.getElementById(whichdiv).innerHTML=' '
}
</script>
<!-- show_text(index# of linktext[] to show, ID of div to write to) -->
<p>
<a href="http://www.dynamicdrive.com" onMouseover="show_text(0,'div1');" onMouseout="resetit('div1');">Dynamic Drive</a> |
<a href="http://www.javascriptkit.com" onMouseover="show_text(1,'div1');" onMouseout="resetit('div1');">JavaScript Kit</a> |
<a href="http://www.freewarejava.com" onMouseover="show_text(2,'div1');" onMouseout="resetit('div1');">Freewarejava</a>
<br>
<span id="div1"> </span>
</body>
</html>
Bookmarks