Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Old 04-24-2005, 07:52 AM Function not defined
nick89's Avatar
Super Talker

Posts: 136
Location: Brisbane, Australia
Trades: 0
I have a page which is rendered by PHP which utilises a collapsable tree-diagram of links.
Some subsections can be collapsed.

I have written my Javascript based on an Article Chroder Blogged a while ago -
When a user expands an area, all of the others should close-
PHP Code:
<script language=”javascript”>
    function 
getItem(id)
    {
        var 
itm false;
        if(
document.getElementById)
            
itm document.getElementById(id);
        else if(
document.all)
            
itm document.all[id];
        else if(
document.layers)
            
itm document.layers[id];

        return 
itm;
    }        
      function 
openItem(id)
    {
            var 
tags document.getElementsByTagName('div');
        if(!
tags)
            return 
false;

        for(var 
0tags.lengthi++)
        {
            if(
tags[i].className == 'left_col')
            {
                    
tags[i].style.display 'none';
            }
        }
        
toggleItem(id);
        return 
false;
    }
    function 
toggleItem(id)
    {
        
itm getItem(id);

        if(!
itm)
            return 
false;

        if(
itm.style.display == ’none’)
            
itm.style.display '’;
        else
            itm.style.display = ’none’;

        return false;
    }
</script> 
I use this
Code:
<a href="javascript: openItem('tepg')" class="leftmenb">
and i get the error openItem is not defined.



Any Help would be greatly appreciated
nick89 is offline
Reply With Quote
View Public Profile Visit nick89's homepage!
 
 
Register now for full access!
Reply     « Reply to Function not defined
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.45005 seconds with 12 queries