jQuery: The Write Less, Do More JavaScript Library

Should jQuery normalize this IE6 bug involving <input/> names?

View: New views
4 Messages — Rating Filter:   Alert me  

Should jQuery normalize this IE6 bug involving <input/> names?

by Brian Peiris :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The alerts in following code do not show the same result in IE6 due to
a bug[1] (also discussed on stackoverflow.com[2]).

$('<input type="hidden" />').attr('name', 'foo').appendTo
(document.body);
alert(document.getElementsByName('foo').length);  // Alert shows "0"
in IE6 and "1" in other browsers


$('<input type="hidden" name="bar" />').appendTo(document.body);
alert(document.getElementsByName('bar').length);  // Alert shows "1"
in all browsers.

Working demo: http://jsbin.com/urajo

Should jQuery normalize or at least warn the user about this
discrepancy (like it does when attempting to change the 'type'
attribute on <input/> elements)?

[1]: http://webbugtrack.blogspot.com/2007/10/bug-235-createelement-is-broken-in-ie.html
[2]: http://stackoverflow.com/questions/1650797/setting-name-of-dom-created-element-fails-in-ie-workaround

--

You received this message because you are subscribed to the Google Groups "jQuery Development" group.
To post to this group, send email to jquery-dev@....
To unsubscribe from this group, send email to jquery-dev+unsubscribe@....
For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en.



Re: Should jQuery normalize this IE6 bug involving <input/> names?

by dave.methvin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> The alerts in following code do not show the same result in
> IE6 due to a bug[1] (also discussed on stackoverflow.com[2]).

That's a well-known bug for those of us who lived through the dark
time when IE6 was the most popular browser in the world (for some
definition of popular).

> Should jQuery normalize or at least warn the user about this
> discrepancy (like it does when attempting to change the 'type'
> attribute on <input/> elements)?

At this point it doesn't seem worth the extra convoluted code to
normalize, since the bug is already documented in a lot of places and
easy for users to work around. Is there a place that makes sense to
mention this in the jQuery docs? If the docs had mentioned it, would
you have found the mention and avoided the bug? Or would it simply
have been one of the first results for your Google of "jQuery ie6
input name bug"?  :-)

--

You received this message because you are subscribed to the Google Groups "jQuery Development" group.
To post to this group, send email to jquery-dev@....
To unsubscribe from this group, send email to jquery-dev+unsubscribe@....
For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en.



Re: Should jQuery normalize this IE6 bug involving <input/> names?

by William Chang-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I think jQuery Docs should warn about well known bugs (that will never
be feasible to fix because of bad browsers like IE6).

There will always be newcomers and all are not equally knowledgeable
about "how to use search".

Sincerely,
William Chang
http://www.williamchang.org
http://www.babybluebox.com

On Oct 30, 9:50 pm, Dave Methvin <dave.meth...@...> wrote:

> > The alerts in following code do not show the same result in
> > IE6 due to a bug[1] (also discussed on stackoverflow.com[2]).
>
> That's a well-known bug for those of us who lived through the dark
> time when IE6 was the most popular browser in the world (for some
> definition of popular).
>
> > Should jQuery normalize or at least warn the user about this
> > discrepancy (like it does when attempting to change the 'type'
> > attribute on <input/> elements)?
>
> At this point it doesn't seem worth the extra convoluted code to
> normalize, since the bug is already documented in a lot of places and
> easy for users to work around. Is there a place that makes sense to
> mention this in the jQuery docs? If the docs had mentioned it, would
> you have found the mention and avoided the bug? Or would it simply
> have been one of the first results for your Google of "jQuery ie6
> input name bug"?  :-)

--

You received this message because you are subscribed to the Google Groups "jQuery Development" group.
To post to this group, send email to jquery-dev@....
To unsubscribe from this group, send email to jquery-dev+unsubscribe@....
For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en.



Re: Should jQuery normalize this IE6 bug involving <input/> names?

by Brian Peiris :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I agree that documentation of these pitfalls, specifically with
relation to jQuery, would be very useful (in addition to sites like
http://webbugtrack.blogspot.com) and I also realize that attempting to
fix this IE6 bug in jQuery would be a waste of time.

In my defence, I'm not usually the type who doesn't RTFM or try a
Google search first. This bug seems obscure to me -- obscure enough to
escape even a thorough search.
I wasn't a web-dev when IE6 was prominent and neither were many new
web-devs, I'm sure other people have and will hit their head against
this.

The good news is that a Google search for "jQuery ie6 input name
bug" (without quotes) links to this discussion on the first page :)


On Nov 3, 3:56 pm, William Chang <diehardb...@...> wrote:

> I think jQuery Docs should warn about well known bugs (that will never
> be feasible to fix because of bad browsers like IE6).
>
> There will always be newcomers and all are not equally knowledgeable
> about "how to use search".
>
> Sincerely,
> William Changhttp://www.williamchang.orghttp://www.babybluebox.com
>
> On Oct 30, 9:50 pm, Dave Methvin <dave.meth...@...> wrote:
>
> > > The alerts in following code do not show the same result in
> > > IE6 due to a bug[1] (also discussed on stackoverflow.com[2]).
>
> > That's a well-known bug for those of us who lived through the dark
> > time when IE6 was the most popular browser in the world (for some
> > definition of popular).
>
> > > Should jQuery normalize or at least warn the user about this
> > > discrepancy (like it does when attempting to change the 'type'
> > > attribute on <input/> elements)?
>
> > At this point it doesn't seem worth the extra convoluted code to
> > normalize, since the bug is already documented in a lot of places and
> > easy for users to work around. Is there a place that makes sense to
> > mention this in the jQuery docs? If the docs had mentioned it, would
> > you have found the mention and avoided the bug? Or would it simply
> > have been one of the first results for your Google of "jQuery ie6
> > input name bug"?  :-)

--

You received this message because you are subscribed to the Google Groups "jQuery Development" group.
To post to this group, send email to jquery-dev@....
To unsubscribe from this group, send email to jquery-dev+unsubscribe@....
For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en.