js not working when framed

N

newbieTW

Hello,

Pls help as I have no idea where the problem is either my js or my
html.

I have 2 web pages namely leftmenu.htm and main.htm. I have a js
function stored in a file. The function is to expand my item list with
an id. Both .htm call the same function and passing different id. They
are working when I run them seperately. I have an index.htm which is a
frame page and points to the above htm files. The leftmenu is not
working anymore. The error is: cl_expcol is not defined. I don't
understand why it is not defined as it is working alone. I'm not sure
if this is JS problem or HTML problem. Your help is appreicated.

Here is my js code:

function cl_expcol(id){
var dge=document.getElementById;
if(!dge)return;
document.getElementById(id).style.display =
(document.getElementById(id).style.display=='none')?'block':'none';
}

Here is my leftmenu.htm
<SCRIPT src="jscripts/collapsibleList.js" text="text/Javascript"
language=Javascript></SCRIPT>

<div align="left" style="width: 278; height: 1217">
<table border="0" cellpadding="0" cellspacing="0"
style="border-collapse:
collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
<tr>
<td width="100%" >
<b><i><font face="Book Antiqua" color="#000080">&nbsp;
<a href="javascript:cl_expcol('menu4')" style="text-decoration:
none">
<font color="#000080">Customer Sites</font></a></font></i></b>
<ul id="menu4">
<li><font face="Book Antiqua" size="2">Company A</font></li>
<li><font face="Book Antiqua" size="2">Company B</font></li>
<li><font face="Book Antiqua" size="2">Company C</font></li>
</ul>
</td>
</tr>
</table>
</div>

Here is my main.htm:

<SCRIPT src="jscripts/collapsibleList.js" text="text/Javascript"
language=Javascript></SCRIPT>
<table width="734" border="0">
<td width="180">
<b>
<a href="javascript:cl_expcol('ex1')" style="text-decoration: none;
font-style: italic">
<font color="#000080" size="2" face="Book Antiqua">News and
Related</font></a><font color="#000080" size="2">
<a href="javascript:cl_expcol('ex1')">
<img border="0" src="IMAGES/leftmenu/next.gif" width="18"
height="18"></a></font></b>
<ul id="ex1">
<li>Globe &amp; Mail</a></font></li>
<li>National Post</a></font></li>
<li>Toronto Star</a></font></li>
<li>Toronto Sun</a></font></li>
</ul>
</td>

Here is my index.htm:

<html>

<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>

<frameset cols="150,*">
<frame name="contents" target="main" src="leftmenu.htm">
<frame name="main" src="main.htm">
<noframes>
<body>

<p>This page uses frames, but your browser doesn't support them.</p>

</body>
</noframes>
</frameset>

</html>

Sorry for the long msg. Any help is greatly appericated. You can email
me at (e-mail address removed)

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top