js not working when framed

Discussion in 'Javascript' started by newbieTW, Jan 5, 2004.

  1. newbieTW

    newbieTW Guest

    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
     
    newbieTW, Jan 5, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Q2hyaXN0b3BoZXI=?=

    Sessions when using Framed web site?

    =?Utf-8?B?Q2hyaXN0b3BoZXI=?=, Jan 25, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    346
    Steve C. Orr [MVP, MCSD]
    Jan 26, 2004
  2. =?Utf-8?B?Q2xhcw==?=
    Replies:
    0
    Views:
    1,506
    =?Utf-8?B?Q2xhcw==?=
    Nov 10, 2005
  3. Chumpmeister

    help read URL from framed JSP

    Chumpmeister, May 28, 2004, in forum: Java
    Replies:
    2
    Views:
    2,339
    ExGuardianReader
    May 29, 2004
  4. ppcguy
    Replies:
    1
    Views:
    622
    Andrea Desole
    Aug 8, 2005
  5. Ricardo Garcia

    about NOT getting framed

    Ricardo Garcia, Sep 23, 2004, in forum: Javascript
    Replies:
    1
    Views:
    101
    kaeli
    Sep 23, 2004
Loading...

Share This Page