Technology Questions

Go Back   Technology Questions > Software Questions > Internet > Internet Explorer

Internet Explorer Discuss IE7 or any other IE version.

Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old 06-30-2007, 03:50 AM
HoffLa
Newsgroup Contributor
 
Posts: n/a
Error in appendChild() (JavaScript, IE7)

In some cases appendChild() changes the reference to the parent object to
reference the object returned by appendChild().

Example:
var form = document.forms['form1'];
var input = document.createElement('<INPUT name="input1">');
input.type = 'HIDDEN';
input.id = 'id1';
form.appendChild(input);

Sometimes the form variable at this point references the appended INPUT
object. I havn't figured out when this happens, the same code works as
expected in most cases.
I have observed this in IE7.0.5730.11, not in IE6 or FireFox.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

 
Old 06-30-2007, 03:50 AM
  #2 (permalink)  
Old 06-30-2007, 04:20 AM
HoffLa
Newsgroup Contributor
 
Posts: n/a
RE: Error in appendChild() (JavaScript, IE7)

Update:
I jumped to conclusions! The problem I had was when I did the following:

var form = document.forms['form1'];
var input = document.createElement('<INPUT name="submit">');
input.type = 'HIDDEN';
input.id = 'id1';
form.appendChild(input);
form.submit(); // IE7 tries to call the INPUT object named submit, which of
course gives an error message.

It is NOT a bug in appendChild(), although the behaviour is new in IE7.

BR
- L
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Reply

Bookmarks

Thread Tools

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
javascript error in every page Andrë Internet Explorer 3 05-06-2007 08:44 AM
Silverlight JavaScript error in Firefox Loren Tablet PC Bloggers 0 05-04-2007 06:10 PM
Silverlight JavaScript error in Firefox Loren Tablet PC Bloggers 0 05-04-2007 05:00 PM
Re: Flash & Javascript Error Message Spikey Windows XP 0 01-04-2007 01:46 AM
Re: Javascript error sangeethavani12@gmail.com Windows XP 0 01-04-2007 01:45 AM


New To Technology Questions? Do You Need Help with Your Computer or Device? Do You Need Help with this site?

All times are GMT -8. The time now is 08:54 PM.


2003 - 2009 All Rights Reserved. Technology Questions

Search Engine Friendly URLs by vBSEO 3.3.0