•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the HTML and CSS section within the Web Development category of DaniWeb, a massive community of 425,928 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,689 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our HTML and CSS advertiser: Lunarpages Web Hosting
Views: 4046 | Replies: 2
![]() |
I get this script error “Invalid argument” when using appendChild(). When in Microsoft Visual Studio Debugger I see “htmlfile: Invalid argument”, and the line it blows up on is t.appendChild(n);
The div I want to append the child div to is the top most div in the dom.
Anyone see what I am doing wrong here?
Thanks
The div I want to append the child div to is the top most div in the dom.
Anyone see what I am doing wrong here?
var t = document.parentWindow.parent.parent.document.getElementById("mod");
var n = document.createElement("div");
n.setAttribute("id", "c_dlg");
t.appendChild(n);Thanks
•
•
Join Date: Oct 2006
Location: Utrecht, The Netherlands
Posts: 9
Reputation:
Rep Power: 0
Solved Threads: 0
•
•
Join Date: Jul 2007
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
This is late reply to this post but it might help someone searching with this problem.
I found that creating the new element within the same document I needed to append to fixed a similar problem I was having.
So in this case creating the new div like this may be a fix for this problem:
Hope this helps someone.
I found that creating the new element within the same document I needed to append to fixed a similar problem I was having.
So in this case creating the new div like this may be a fix for this problem:
javascript Syntax (Toggle Plain Text)
document.parentWindow.parent.parent.document.createElement("div");
Hope this helps someone.
![]() |
•
•
•
•
•
•
•
•
DaniWeb HTML and CSS Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Invalid Syntax Error in IE (Viruses, Spyware and other Nasties)
- HELP - Invalid object error related to sqlole null bug in MSSQL 2000 (MS SQL)
- Helllppp..> <<invalid Syntax Error>> (Viruses, Spyware and other Nasties)
- Hijack + Explorer invalid syntax error (Viruses, Spyware and other Nasties)
- Invalid Syntax Error (Viruses, Spyware and other Nasties)
Other Threads in the HTML and CSS Forum
- Previous Thread: My Site Says "Untitled Document"
- Next Thread: changing frame color


Linear Mode