gwen32540
09-01-2007, 06:48 PM
1) Script Title: Link Description
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex5/linkdescribe.htm
3) Describe problem: The code below generates an "object expected" error.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<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>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I also have the following script at the top of the page. I am only including this here because I want to know whether (a) the Link Description script needs modification, or (b) there is a conflict between the two scripts.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<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>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Many, many thanks in advance!
Gwen H
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex5/linkdescribe.htm
3) Describe problem: The code below generates an "object expected" error.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<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>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I also have the following script at the top of the page. I am only including this here because I want to know whether (a) the Link Description script needs modification, or (b) there is a conflict between the two scripts.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<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>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Many, many thanks in advance!
Gwen H