Wrox Programmer Forums
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 28th, 2006, 01:48 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 139
Thanks: 0
Thanked 0 Times in 0 Posts
Default Object expected

Hey,

I guess this weird error "Object Expected"... Now I know that it means that it can't find a specifc function/variable/etc... But the issue is that it only happens when I copy this function within the .js file. But if I comment out the whole function it finds the function, and I dont' get the error, but if I comment the insde of the createTable function (ie have noting withing the {}, it still gives me the Object Expected error... Like what gives?

function createTable(id,label,col,class)
{
    var nTable = document.createElement("table");
    var nThead = document.createElement("thead");

    var nRow = document.createElement("tr");
    var nHdr = document.createElement("th");
    var nText = document.createTextNode(label);

    nHdr.appendChild(nText);
    nHdr.colSpan = col;
    nRow.appendChild(nHdr);
    nThead.appendChild(nRow);

    nTable.id = id;
    nTable.className = class;
    nTable.appendChild(nThead);
    document.getElementById('userSelection').appendChi ld(nTable);
}

 
Old September 28th, 2006, 05:32 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 139
Thanks: 0
Thanked 0 Times in 0 Posts
Default

NM






Similar Threads
Thread Thread Starter Forum Replies Last Post
Object Expected!! Apocolypse2005 Javascript 0 July 3rd, 2006 12:23 PM
object expected crmpicco Javascript 3 April 19th, 2006 09:07 AM
object expected line 0 rcard Javascript 0 June 22nd, 2005 01:35 PM
object expected shoakat Classic ASP Databases 3 September 20th, 2004 08:12 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.