Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > js not working when framed

Reply
Thread Tools

js not working when framed

 
 
newbieTW
Guest
Posts: n/a
 
      01-05-2004
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

Thanks
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
__doPostBack and Response.direct not working in non-framed pages. =?Utf-8?B?Q2xhcw==?= ASP .Net 0 11-10-2005 01:35 PM
servlet help - redirecting from within a framed servlet ppcguy Java 1 08-08-2005 03:03 PM
about NOT getting framed Ricardo Garcia Javascript 1 09-23-2004 02:05 PM
help read URL from framed JSP Chumpmeister Java 2 05-29-2004 10:08 AM
Sessions when using Framed web site? =?Utf-8?B?Q2hyaXN0b3BoZXI=?= ASP .Net 1 01-26-2004 12:35 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57