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
Undefined is null or not an object - HELP!
Old 06-17-2009, 10:02 PM Undefined is null or not an object - HELP!
Experienced Talker

Posts: 38
Trades: 0
Hi all,
The following script WORKS, but throws a "undefined is null or not an object" error in IE:

Code:
    <script type="text/javascript">
            window.onload = function() {
                var table = document.getElementById('expandable_table');
                if (table) {
                    var trs = table.getElementsByTagName('tr');
                    for(var i = 0; i < trs.length; i++) {
                        var a = trs[i].getElementsByTagName('td')[0].getElementsByTagName('a')[0];
                        a.onclick = function() {
                            var span = this.parentNode.getElementsByTagName('span')[0];
                            span.style.display = span.style.display == 'none' ? 'block' : 'none';
                            this.firstChild.nodeValue = span.style.display == 'none' ? 'More' : 'Less';
                        };
                    }
                }
            };
        </script>
Anyone have any suggestions? Any help appreciated!

George
__________________
For Sale: AttitudeProblems.com and Zunes.org PM with offers.
HeyGeek.com is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-18-2009, 11:59 AM Re: Undefined is null or not an object - HELP!
Experienced Talker

Posts: 38
Trades: 0
Anyone? I could really use some help with this...
__________________
For Sale: AttitudeProblems.com and Zunes.org PM with offers.
HeyGeek.com is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Undefined is null or not an object - HELP!
 

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.42227 seconds with 12 queries