[jquery-dev] Re: IE issue with .append?
Ok, done: http://docs.jquery.com/Core/jQuery#htmlownerDocument --John On Tue, Jun 23, 2009 at 3:20 PM, Daniel Friesen wrote: > > Can we update the documentation to also note that unclosed tags aren't > supported. > Malformed html is obvious, but people don't always think of a single tag > as malformed html. > > ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name] > > John Resig wrote: >> To be clear: jQuery supports the pattern, it just requires the closing /. >> >> $("") // ok >> $("") // ambiguous, malformed, not ok >> >> $("") // ok >> $("") // ambiguous, malformed, not ok >> >> --John >> >> >> >> On Tue, Jun 23, 2009 at 10:37 AM, Daniel >> Friesen wrote: >> >>> http://www.google.com/codesearch?hl=en&lr=&q=\%24\([%27%22]%3C[^%3C%3E%25]%2B[^%2F]%3E[%27%22]\)+lang%3Ajs&sbtn=Search >>> >>> I would have thought there'd be more. Frankly it is a sane way to think, >>> jquery is dom manipulation and $('') looks a lot like tag creation >>> rather than something than html being mixed into jQuery. >>> I for one have been thinking of $('<...>') as tag creation rather than >>> raw html, or thinking that jQuery did it's own quick parsing for ages. >>> Now I'll have to go back through 6 months of code to track down all the >>> code using that pattern. >>> >>> ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name] >>> >>> John Resig wrote: >>> I'm hesitant to support that since it tends to promote passing in malformed (X)HTML. At least with it's obvious that it should be a standalone. --John On Tue, Jun 23, 2009 at 12:27 AM, Daniel Friesen wrote: > Ok, I agree that $('') is just plain malformed html > and doesn't need support. > But to be honest $('') looks like we're saying to create a span > node, and likewise $('') like we're trying to create a > span with a single attr. > Originally when I found out about $('') I wasn't thinking HTML, I > originally thought "Oh yay, jQuery has a shortcut for > document.createElement, and after when I saw that $('') > was possible I didn't think HTML, I still thought, createElement + attr > setting. > > Would a patch that just makes $('') work properly across > browsers be accepted? > > That should be something simple like checking if it starts with < and > ends with >, contains no other <>'s and doesn't have a / before the > > then insert a single / before the last > before continuing. > > ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name] > > John Resig wrote: > > >> Unfortunately, there's not really a whole lot that we can do on our >> end to fix a problem like that - short of including a full HTML >> parser/DOM generator. >> >> Now, I've written one: >> http://ejohn.org/blog/pure-javascript-html-parser/ >> >> but it's probably just better to make sure that your injected HTML is >> well-formed. >> >> --John >> >> >> >> On Mon, Jun 22, 2009 at 6:45 PM, Daniel >> Friesen wrote: >> >> >> >>> I ran into another IE issue with unclosed tag syntax inside node >>> creation (I personally like to leave the / out unless necessary most of >>> the time, especially since it flows fairly nice with .text(userVar)). >>> >>> http://jsbin.com/ejote >>> >>> >>> >>> >>> >>> >>> >>> All work in ie7, ie8, opera, firefox, and midori. >>> >>> However: >>> >>> >>> >>> Fail in ie7 and ie8 while they work in firefox, midori, and opera. >>> >>> Filed as: http://dev.jquery.com/ticket/4806 >>> >>> ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name] >>> >>> John Resig wrote: >>> >>> >>> This is very helpful analysis. I've added it to my todo list. Could you file a ticket with your test cases, as well? Thanks! http://dev.jquery.com/newticket --John On Mon, Jun 22, 2009 at 4:33 PM, Daniel Friesen wrote: > Ok, narrowed it down. > Someone tells me that Konqueror isn't working for that page either so > it > looks like IE8 and Konqueror may share this behavior. > From the looks of it $button.append( "[" ); is working. > > $('#bodyContent').append( "[" ); // works > $('#bodyContent').append( "[", "]" ); // "Invalid argument" in IE8 > console, works in FF Firebug console > $('#bodyContent').append( "asdf", "asdf" ); // "Invalid argument" in > IE8 console, works in FF Firebug console > $('#bodyContent').append( document.createTextNode("["), "]" ); // > works > $('#bodyContent').append( "foo", "]" ); // in IE8 > console only inserts the ']' the foo sp
[jquery-dev] Re: IE issue with .append?
Can we update the documentation to also note that unclosed tags aren't supported. Malformed html is obvious, but people don't always think of a single tag as malformed html. ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name] John Resig wrote: > To be clear: jQuery supports the pattern, it just requires the closing /. > > $("") // ok > $("") // ambiguous, malformed, not ok > > $("") // ok > $("") // ambiguous, malformed, not ok > > --John > > > > On Tue, Jun 23, 2009 at 10:37 AM, Daniel > Friesen wrote: > >> http://www.google.com/codesearch?hl=en&lr=&q=\%24\([%27%22]%3C[^%3C%3E%25]%2B[^%2F]%3E[%27%22]\)+lang%3Ajs&sbtn=Search >> >> I would have thought there'd be more. Frankly it is a sane way to think, >> jquery is dom manipulation and $('') looks a lot like tag creation >> rather than something than html being mixed into jQuery. >> I for one have been thinking of $('<...>') as tag creation rather than >> raw html, or thinking that jQuery did it's own quick parsing for ages. >> Now I'll have to go back through 6 months of code to track down all the >> code using that pattern. >> >> ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name] >> >> John Resig wrote: >> >>> I'm hesitant to support that since it tends to promote passing in >>> malformed (X)HTML. At least with it's obvious that >>> it should be a standalone. >>> >>> --John >>> >>> >>> >>> On Tue, Jun 23, 2009 at 12:27 AM, Daniel >>> Friesen wrote: >>> >>> Ok, I agree that $('') is just plain malformed html and doesn't need support. But to be honest $('') looks like we're saying to create a span node, and likewise $('') like we're trying to create a span with a single attr. Originally when I found out about $('') I wasn't thinking HTML, I originally thought "Oh yay, jQuery has a shortcut for document.createElement, and after when I saw that $('') was possible I didn't think HTML, I still thought, createElement + attr setting. Would a patch that just makes $('') work properly across browsers be accepted? That should be something simple like checking if it starts with < and ends with >, contains no other <>'s and doesn't have a / before the > then insert a single / before the last > before continuing. ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name] John Resig wrote: > Unfortunately, there's not really a whole lot that we can do on our > end to fix a problem like that - short of including a full HTML > parser/DOM generator. > > Now, I've written one: > http://ejohn.org/blog/pure-javascript-html-parser/ > > but it's probably just better to make sure that your injected HTML is > well-formed. > > --John > > > > On Mon, Jun 22, 2009 at 6:45 PM, Daniel > Friesen wrote: > > > >> I ran into another IE issue with unclosed tag syntax inside node >> creation (I personally like to leave the / out unless necessary most of >> the time, especially since it flows fairly nice with .text(userVar)). >> >> http://jsbin.com/ejote >> >> >> >> >> >> >> >> All work in ie7, ie8, opera, firefox, and midori. >> >> However: >> >> >> >> Fail in ie7 and ie8 while they work in firefox, midori, and opera. >> >> Filed as: http://dev.jquery.com/ticket/4806 >> >> ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name] >> >> John Resig wrote: >> >> >> >>> This is very helpful analysis. I've added it to my todo list. Could >>> you file a ticket with your test cases, as well? Thanks! >>> http://dev.jquery.com/newticket >>> >>> --John >>> >>> >>> >>> On Mon, Jun 22, 2009 at 4:33 PM, Daniel >>> Friesen wrote: >>> >>> >>> >>> Ok, narrowed it down. Someone tells me that Konqueror isn't working for that page either so it looks like IE8 and Konqueror may share this behavior. From the looks of it $button.append( "[" ); is working. $('#bodyContent').append( "[" ); // works $('#bodyContent').append( "[", "]" ); // "Invalid argument" in IE8 console, works in FF Firebug console $('#bodyContent').append( "asdf", "asdf" ); // "Invalid argument" in IE8 console, works in FF Firebug console $('#bodyContent').append( document.createTextNode("["), "]" ); // works $('#bodyContent').append( "foo", "]" ); // in IE8 console only inserts the ']' the foo span is not inserted, works in FF Firebug console $('#bodyContent').append( "asdf", "qwerty" ); // in IE8 console only inserts the qwerty span the asdf span is not inserted, works in FF Firebug
[jquery-dev] Re: IE issue with .append?
Yeah, I think all outstanding bugs with that were fixed in 1.3.0. --John On Tue, Jun 23, 2009 at 2:56 PM, Kelvin Luck wrote: > > On Tue, 23 Jun 2009 12:40:11 -0400, John Resig wrote: > >> >> To be clear: jQuery supports the pattern, it just requires the closing /. >> >> $("") // ok > > Although I do know that at least one version of jQuery this would cause > errors in IE (6 I believe) under some circumstances. > > I had to replace that code in one of my plugins with: > > $('') > > I haven't tested with the latest jQuery though so this may not be an issue > any more... > > Kelvin :) > > > > --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to jquery-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en -~--~~~~--~~--~--~---
[jquery-dev] Re: IE issue with .append?
On Tue, 23 Jun 2009 12:40:11 -0400, John Resig wrote: > > To be clear: jQuery supports the pattern, it just requires the closing /. > > $("") // ok Although I do know that at least one version of jQuery this would cause errors in IE (6 I believe) under some circumstances. I had to replace that code in one of my plugins with: $('') I haven't tested with the latest jQuery though so this may not be an issue any more... Kelvin :) --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to jquery-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en -~--~~~~--~~--~--~---
[jquery-dev] Re: IE issue with .append?
To be clear: jQuery supports the pattern, it just requires the closing /. $("") // ok $("") // ambiguous, malformed, not ok $("") // ok $("") // ambiguous, malformed, not ok --John On Tue, Jun 23, 2009 at 10:37 AM, Daniel Friesen wrote: > > http://www.google.com/codesearch?hl=en&lr=&q=\%24\([%27%22]%3C[^%3C%3E%25]%2B[^%2F]%3E[%27%22]\)+lang%3Ajs&sbtn=Search > > I would have thought there'd be more. Frankly it is a sane way to think, > jquery is dom manipulation and $('') looks a lot like tag creation > rather than something than html being mixed into jQuery. > I for one have been thinking of $('<...>') as tag creation rather than > raw html, or thinking that jQuery did it's own quick parsing for ages. > Now I'll have to go back through 6 months of code to track down all the > code using that pattern. > > ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name] > > John Resig wrote: >> I'm hesitant to support that since it tends to promote passing in >> malformed (X)HTML. At least with it's obvious that >> it should be a standalone. >> >> --John >> >> >> >> On Tue, Jun 23, 2009 at 12:27 AM, Daniel >> Friesen wrote: >> >>> Ok, I agree that $('') is just plain malformed html >>> and doesn't need support. >>> But to be honest $('') looks like we're saying to create a span >>> node, and likewise $('') like we're trying to create a >>> span with a single attr. >>> Originally when I found out about $('') I wasn't thinking HTML, I >>> originally thought "Oh yay, jQuery has a shortcut for >>> document.createElement, and after when I saw that $('') >>> was possible I didn't think HTML, I still thought, createElement + attr >>> setting. >>> >>> Would a patch that just makes $('') work properly across >>> browsers be accepted? >>> >>> That should be something simple like checking if it starts with < and >>> ends with >, contains no other <>'s and doesn't have a / before the > >>> then insert a single / before the last > before continuing. >>> >>> ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name] >>> >>> John Resig wrote: >>> Unfortunately, there's not really a whole lot that we can do on our end to fix a problem like that - short of including a full HTML parser/DOM generator. Now, I've written one: http://ejohn.org/blog/pure-javascript-html-parser/ but it's probably just better to make sure that your injected HTML is well-formed. --John On Mon, Jun 22, 2009 at 6:45 PM, Daniel Friesen wrote: > I ran into another IE issue with unclosed tag syntax inside node > creation (I personally like to leave the / out unless necessary most of > the time, especially since it flows fairly nice with .text(userVar)). > > http://jsbin.com/ejote > > > > > > > > All work in ie7, ie8, opera, firefox, and midori. > > However: > > > > Fail in ie7 and ie8 while they work in firefox, midori, and opera. > > Filed as: http://dev.jquery.com/ticket/4806 > > ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name] > > John Resig wrote: > > >> This is very helpful analysis. I've added it to my todo list. Could >> you file a ticket with your test cases, as well? Thanks! >> http://dev.jquery.com/newticket >> >> --John >> >> >> >> On Mon, Jun 22, 2009 at 4:33 PM, Daniel >> Friesen wrote: >> >> >> >>> Ok, narrowed it down. >>> Someone tells me that Konqueror isn't working for that page either so it >>> looks like IE8 and Konqueror may share this behavior. >>> From the looks of it $button.append( "[" ); is working. >>> >>> $('#bodyContent').append( "[" ); // works >>> $('#bodyContent').append( "[", "]" ); // "Invalid argument" in IE8 >>> console, works in FF Firebug console >>> $('#bodyContent').append( "asdf", "asdf" ); // "Invalid argument" in >>> IE8 console, works in FF Firebug console >>> $('#bodyContent').append( document.createTextNode("["), "]" ); // works >>> $('#bodyContent').append( "foo", "]" ); // in IE8 console >>> only inserts the ']' the foo span is not inserted, works in FF Firebug >>> console >>> $('#bodyContent').append( "asdf", "qwerty" ); >>> // in IE8 console only inserts the qwerty span the asdf span is not >>> inserted, works in FF Firebug console >>> >>> So this looks like an IE8 (maybe Konqueror) issue where when .domManip >>> is used (by something like .append) with more than one argument with the >>> first being a string a "Invalid argument" error is thrown if the first >>> argument is not a valid node string. If the first argument is a valid >>> node string, instead the first argument is ignored and the rest are >>> inserted. >>> >>> ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name] >
[jquery-dev] Re: IE issue with .append?
http://www.google.com/codesearch?hl=en&lr=&q=\%24\([%27%22]%3C[^%3C%3E%25]%2B[^%2F]%3E[%27%22]\)+lang%3Ajs&sbtn=Search I would have thought there'd be more. Frankly it is a sane way to think, jquery is dom manipulation and $('') looks a lot like tag creation rather than something than html being mixed into jQuery. I for one have been thinking of $('<...>') as tag creation rather than raw html, or thinking that jQuery did it's own quick parsing for ages. Now I'll have to go back through 6 months of code to track down all the code using that pattern. ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name] John Resig wrote: > I'm hesitant to support that since it tends to promote passing in > malformed (X)HTML. At least with it's obvious that > it should be a standalone. > > --John > > > > On Tue, Jun 23, 2009 at 12:27 AM, Daniel > Friesen wrote: > >> Ok, I agree that $('') is just plain malformed html >> and doesn't need support. >> But to be honest $('') looks like we're saying to create a span >> node, and likewise $('') like we're trying to create a >> span with a single attr. >> Originally when I found out about $('') I wasn't thinking HTML, I >> originally thought "Oh yay, jQuery has a shortcut for >> document.createElement, and after when I saw that $('') >> was possible I didn't think HTML, I still thought, createElement + attr >> setting. >> >> Would a patch that just makes $('') work properly across >> browsers be accepted? >> >> That should be something simple like checking if it starts with < and >> ends with >, contains no other <>'s and doesn't have a / before the > >> then insert a single / before the last > before continuing. >> >> ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name] >> >> John Resig wrote: >> >>> Unfortunately, there's not really a whole lot that we can do on our >>> end to fix a problem like that - short of including a full HTML >>> parser/DOM generator. >>> >>> Now, I've written one: >>> http://ejohn.org/blog/pure-javascript-html-parser/ >>> >>> but it's probably just better to make sure that your injected HTML is >>> well-formed. >>> >>> --John >>> >>> >>> >>> On Mon, Jun 22, 2009 at 6:45 PM, Daniel >>> Friesen wrote: >>> >>> I ran into another IE issue with unclosed tag syntax inside node creation (I personally like to leave the / out unless necessary most of the time, especially since it flows fairly nice with .text(userVar)). http://jsbin.com/ejote All work in ie7, ie8, opera, firefox, and midori. However: Fail in ie7 and ie8 while they work in firefox, midori, and opera. Filed as: http://dev.jquery.com/ticket/4806 ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name] John Resig wrote: > This is very helpful analysis. I've added it to my todo list. Could > you file a ticket with your test cases, as well? Thanks! > http://dev.jquery.com/newticket > > --John > > > > On Mon, Jun 22, 2009 at 4:33 PM, Daniel > Friesen wrote: > > > >> Ok, narrowed it down. >> Someone tells me that Konqueror isn't working for that page either so it >> looks like IE8 and Konqueror may share this behavior. >> From the looks of it $button.append( "[" ); is working. >> >> $('#bodyContent').append( "[" ); // works >> $('#bodyContent').append( "[", "]" ); // "Invalid argument" in IE8 >> console, works in FF Firebug console >> $('#bodyContent').append( "asdf", "asdf" ); // "Invalid argument" in IE8 >> console, works in FF Firebug console >> $('#bodyContent').append( document.createTextNode("["), "]" ); // works >> $('#bodyContent').append( "foo", "]" ); // in IE8 console >> only inserts the ']' the foo span is not inserted, works in FF Firebug >> console >> $('#bodyContent').append( "asdf", "qwerty" ); >> // in IE8 console only inserts the qwerty span the asdf span is not >> inserted, works in FF Firebug console >> >> So this looks like an IE8 (maybe Konqueror) issue where when .domManip >> is used (by something like .append) with more than one argument with the >> first being a string a "Invalid argument" error is thrown if the first >> argument is not a valid node string. If the first argument is a valid >> node string, instead the first argument is ignored and the rest are >> inserted. >> >> ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name] >> >> John Resig wrote: >> >> >> >>> You say that you still have problems if you split apart the query. >>> >>> So in this case $button.append( "[" ) fails - correct? >>> >>> What happens if you do: >>> >>> $button.append( document.createTextNode("[") ) >>> >>> --John >>>
[jquery-dev] Re: IE issue with .append?
I'm hesitant to support that since it tends to promote passing in malformed (X)HTML. At least with it's obvious that it should be a standalone. --John On Tue, Jun 23, 2009 at 12:27 AM, Daniel Friesen wrote: > > Ok, I agree that $('') is just plain malformed html > and doesn't need support. > But to be honest $('') looks like we're saying to create a span > node, and likewise $('') like we're trying to create a > span with a single attr. > Originally when I found out about $('') I wasn't thinking HTML, I > originally thought "Oh yay, jQuery has a shortcut for > document.createElement, and after when I saw that $('') > was possible I didn't think HTML, I still thought, createElement + attr > setting. > > Would a patch that just makes $('') work properly across > browsers be accepted? > > That should be something simple like checking if it starts with < and > ends with >, contains no other <>'s and doesn't have a / before the > > then insert a single / before the last > before continuing. > > ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name] > > John Resig wrote: >> Unfortunately, there's not really a whole lot that we can do on our >> end to fix a problem like that - short of including a full HTML >> parser/DOM generator. >> >> Now, I've written one: >> http://ejohn.org/blog/pure-javascript-html-parser/ >> >> but it's probably just better to make sure that your injected HTML is >> well-formed. >> >> --John >> >> >> >> On Mon, Jun 22, 2009 at 6:45 PM, Daniel >> Friesen wrote: >> >>> I ran into another IE issue with unclosed tag syntax inside node >>> creation (I personally like to leave the / out unless necessary most of >>> the time, especially since it flows fairly nice with .text(userVar)). >>> >>> http://jsbin.com/ejote >>> >>> >>> >>> >>> >>> >>> >>> All work in ie7, ie8, opera, firefox, and midori. >>> >>> However: >>> >>> >>> >>> Fail in ie7 and ie8 while they work in firefox, midori, and opera. >>> >>> Filed as: http://dev.jquery.com/ticket/4806 >>> >>> ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name] >>> >>> John Resig wrote: >>> This is very helpful analysis. I've added it to my todo list. Could you file a ticket with your test cases, as well? Thanks! http://dev.jquery.com/newticket --John On Mon, Jun 22, 2009 at 4:33 PM, Daniel Friesen wrote: > Ok, narrowed it down. > Someone tells me that Konqueror isn't working for that page either so it > looks like IE8 and Konqueror may share this behavior. > From the looks of it $button.append( "[" ); is working. > > $('#bodyContent').append( "[" ); // works > $('#bodyContent').append( "[", "]" ); // "Invalid argument" in IE8 > console, works in FF Firebug console > $('#bodyContent').append( "asdf", "asdf" ); // "Invalid argument" in IE8 > console, works in FF Firebug console > $('#bodyContent').append( document.createTextNode("["), "]" ); // works > $('#bodyContent').append( "foo", "]" ); // in IE8 console > only inserts the ']' the foo span is not inserted, works in FF Firebug > console > $('#bodyContent').append( "asdf", "qwerty" ); > // in IE8 console only inserts the qwerty span the asdf span is not > inserted, works in FF Firebug console > > So this looks like an IE8 (maybe Konqueror) issue where when .domManip > is used (by something like .append) with more than one argument with the > first being a string a "Invalid argument" error is thrown if the first > argument is not a valid node string. If the first argument is a valid > node string, instead the first argument is ignored and the rest are > inserted. > > ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name] > > John Resig wrote: > > >> You say that you still have problems if you split apart the query. >> >> So in this case $button.append( "[" ) fails - correct? >> >> What happens if you do: >> >> $button.append( document.createTextNode("[") ) >> >> --John >> >> >> >> On Mon, Jun 22, 2009 at 2:09 PM, Daniel >> Friesen wrote: >> >> >> >>> I've been having trouble with a bit of jQuery that works in FF, Opera, >>> and Midori, but breaks in IE. >>> >>> See http://animanga.wikia.com/wiki/Sandbox?allinone=0 >>> The code: http://dev.wikia.com/wiki/ShowHide/code.js >>> (it's on a wiki, so you can see the history of editing) >>> >>> Using IE8's debugger tools (yay, finally MS rips of Firebug to give us a >>> way to find out why IE is breaking /sarcasm) I've narrowed it down to >>> $button.append( '[', $buttonLink, ']' ); Where jQuery's .append calls >>> .clean which near the end calls fragment.appendChild( ret[i] ); fragment >>> is the document, and i is 0, ret is 3 items in length containing the >>> text node, span, and other text
[jquery-dev] Re: IE issue with .append?
Why support bad mark-up? Adding the slash costs nothing. On Jun 23, 1:27 am, Daniel Friesen wrote: > Ok, I agree that $('') is just plain malformed html > and doesn't need support. > But to be honest $('') looks like we're saying to create a span > node, and likewise $('') like we're trying to create a > span with a single attr. > Originally when I found out about $('') I wasn't thinking HTML, I > originally thought "Oh yay, jQuery has a shortcut for > document.createElement, and after when I saw that $('') > was possible I didn't think HTML, I still thought, createElement + attr > setting. > > Would a patch that just makes $('') work properly across > browsers be accepted? > > That should be something simple like checking if it starts with < and > ends with >, contains no other <>'s and doesn't have a / before the > > then insert a single / before the last > before continuing. > > ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name] > > John Resig wrote: > > Unfortunately, there's not really a whole lot that we can do on our > > end to fix a problem like that - short of including a full HTML > > parser/DOM generator. > > > Now, I've written one: > >http://ejohn.org/blog/pure-javascript-html-parser/ > > > but it's probably just better to make sure that your injected HTML is > > well-formed. > > > --John > > > On Mon, Jun 22, 2009 at 6:45 PM, Daniel > > Friesen wrote: > > >> I ran into another IE issue with unclosed tag syntax inside node > >> creation (I personally like to leave the / out unless necessary most of > >> the time, especially since it flows fairly nice with .text(userVar)). > > >>http://jsbin.com/ejote > > >> > >> > >> > >> > >> > > >> All work in ie7, ie8, opera, firefox, and midori. > > >> However: > >> > >> > > >> Fail in ie7 and ie8 while they work in firefox, midori, and opera. > > >> Filed as:http://dev.jquery.com/ticket/4806 > > >> ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name] > > >> John Resig wrote: > > >>> This is very helpful analysis. I've added it to my todo list. Could > >>> you file a ticket with your test cases, as well? Thanks! > >>>http://dev.jquery.com/newticket > > >>> --John > > >>> On Mon, Jun 22, 2009 at 4:33 PM, Daniel > >>> Friesen wrote: > > Ok, narrowed it down. > Someone tells me that Konqueror isn't working for that page either so it > looks like IE8 and Konqueror may share this behavior. > From the looks of it $button.append( "[" ); is working. > > $('#bodyContent').append( "[" ); // works > $('#bodyContent').append( "[", "]" ); // "Invalid argument" in IE8 > console, works in FF Firebug console > $('#bodyContent').append( "asdf", "asdf" ); // "Invalid argument" in IE8 > console, works in FF Firebug console > $('#bodyContent').append( document.createTextNode("["), "]" ); // works > $('#bodyContent').append( "foo", "]" ); // in IE8 console > only inserts the ']' the foo span is not inserted, works in FF Firebug > console > $('#bodyContent').append( "asdf", "qwerty" ); > // in IE8 console only inserts the qwerty span the asdf span is not > inserted, works in FF Firebug console > > So this looks like an IE8 (maybe Konqueror) issue where when .domManip > is used (by something like .append) with more than one argument with the > first being a string a "Invalid argument" error is thrown if the first > argument is not a valid node string. If the first argument is a valid > node string, instead the first argument is ignored and the rest are > inserted. > > ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name] > > John Resig wrote: > > > You say that you still have problems if you split apart the query. > > > So in this case $button.append( "[" ) fails - correct? > > > What happens if you do: > > > $button.append( document.createTextNode("[") ) > > > --John > > > On Mon, Jun 22, 2009 at 2:09 PM, Daniel > > Friesen wrote: > > >> I've been having trouble with a bit of jQuery that works in FF, Opera, > >> and Midori, but breaks in IE. > > >> Seehttp://animanga.wikia.com/wiki/Sandbox?allinone=0 > >> The code:http://dev.wikia.com/wiki/ShowHide/code.js > >> (it's on a wiki, so you can see the history of editing) > > >> Using IE8's debugger tools (yay, finally MS rips of Firebug to give us > >> a > >> way to find out why IE is breaking /sarcasm) I've narrowed it down to > >> $button.append( '[', $buttonLink, ']' ); Where jQuery's .append calls > >> .clean which near the end calls fragment.appendChild( ret[i] ); > >> fragment > >> is the document, and i is 0, ret is 3 items in length containing the > >> text node, span, and other text node. jQuery tries to appendChild to > >> the > >> document and IE decides it doesn't like it. > > >> Does this seem like a jQuery bug? > > >> Note: ya, I
[jquery-dev] Re: IE issue with .append?
Ok, I agree that $('') is just plain malformed html and doesn't need support. But to be honest $('') looks like we're saying to create a span node, and likewise $('') like we're trying to create a span with a single attr. Originally when I found out about $('') I wasn't thinking HTML, I originally thought "Oh yay, jQuery has a shortcut for document.createElement, and after when I saw that $('') was possible I didn't think HTML, I still thought, createElement + attr setting. Would a patch that just makes $('') work properly across browsers be accepted? That should be something simple like checking if it starts with < and ends with >, contains no other <>'s and doesn't have a / before the > then insert a single / before the last > before continuing. ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name] John Resig wrote: > Unfortunately, there's not really a whole lot that we can do on our > end to fix a problem like that - short of including a full HTML > parser/DOM generator. > > Now, I've written one: > http://ejohn.org/blog/pure-javascript-html-parser/ > > but it's probably just better to make sure that your injected HTML is > well-formed. > > --John > > > > On Mon, Jun 22, 2009 at 6:45 PM, Daniel > Friesen wrote: > >> I ran into another IE issue with unclosed tag syntax inside node >> creation (I personally like to leave the / out unless necessary most of >> the time, especially since it flows fairly nice with .text(userVar)). >> >> http://jsbin.com/ejote >> >> >> >> >> >> >> >> All work in ie7, ie8, opera, firefox, and midori. >> >> However: >> >> >> >> Fail in ie7 and ie8 while they work in firefox, midori, and opera. >> >> Filed as: http://dev.jquery.com/ticket/4806 >> >> ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name] >> >> John Resig wrote: >> >>> This is very helpful analysis. I've added it to my todo list. Could >>> you file a ticket with your test cases, as well? Thanks! >>> http://dev.jquery.com/newticket >>> >>> --John >>> >>> >>> >>> On Mon, Jun 22, 2009 at 4:33 PM, Daniel >>> Friesen wrote: >>> >>> Ok, narrowed it down. Someone tells me that Konqueror isn't working for that page either so it looks like IE8 and Konqueror may share this behavior. From the looks of it $button.append( "[" ); is working. $('#bodyContent').append( "[" ); // works $('#bodyContent').append( "[", "]" ); // "Invalid argument" in IE8 console, works in FF Firebug console $('#bodyContent').append( "asdf", "asdf" ); // "Invalid argument" in IE8 console, works in FF Firebug console $('#bodyContent').append( document.createTextNode("["), "]" ); // works $('#bodyContent').append( "foo", "]" ); // in IE8 console only inserts the ']' the foo span is not inserted, works in FF Firebug console $('#bodyContent').append( "asdf", "qwerty" ); // in IE8 console only inserts the qwerty span the asdf span is not inserted, works in FF Firebug console So this looks like an IE8 (maybe Konqueror) issue where when .domManip is used (by something like .append) with more than one argument with the first being a string a "Invalid argument" error is thrown if the first argument is not a valid node string. If the first argument is a valid node string, instead the first argument is ignored and the rest are inserted. ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name] John Resig wrote: > You say that you still have problems if you split apart the query. > > So in this case $button.append( "[" ) fails - correct? > > What happens if you do: > > $button.append( document.createTextNode("[") ) > > --John > > > > On Mon, Jun 22, 2009 at 2:09 PM, Daniel > Friesen wrote: > > > >> I've been having trouble with a bit of jQuery that works in FF, Opera, >> and Midori, but breaks in IE. >> >> See http://animanga.wikia.com/wiki/Sandbox?allinone=0 >> The code: http://dev.wikia.com/wiki/ShowHide/code.js >> (it's on a wiki, so you can see the history of editing) >> >> Using IE8's debugger tools (yay, finally MS rips of Firebug to give us a >> way to find out why IE is breaking /sarcasm) I've narrowed it down to >> $button.append( '[', $buttonLink, ']' ); Where jQuery's .append calls >> .clean which near the end calls fragment.appendChild( ret[i] ); fragment >> is the document, and i is 0, ret is 3 items in length containing the >> text node, span, and other text node. jQuery tries to appendChild to the >> document and IE decides it doesn't like it. >> >> Does this seem like a jQuery bug? >> >> Note: ya, I have tried splitting the append call into three separate >> ones, still causes the same issue on the first one. >> >> -- >> ~Daniel Friesen
[jquery-dev] Re: IE issue with .append?
Unfortunately, there's not really a whole lot that we can do on our end to fix a problem like that - short of including a full HTML parser/DOM generator. Now, I've written one: http://ejohn.org/blog/pure-javascript-html-parser/ but it's probably just better to make sure that your injected HTML is well-formed. --John On Mon, Jun 22, 2009 at 6:45 PM, Daniel Friesen wrote: > > I ran into another IE issue with unclosed tag syntax inside node > creation (I personally like to leave the / out unless necessary most of > the time, especially since it flows fairly nice with .text(userVar)). > > http://jsbin.com/ejote > > > > > > > > All work in ie7, ie8, opera, firefox, and midori. > > However: > > > > Fail in ie7 and ie8 while they work in firefox, midori, and opera. > > Filed as: http://dev.jquery.com/ticket/4806 > > ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name] > > John Resig wrote: >> This is very helpful analysis. I've added it to my todo list. Could >> you file a ticket with your test cases, as well? Thanks! >> http://dev.jquery.com/newticket >> >> --John >> >> >> >> On Mon, Jun 22, 2009 at 4:33 PM, Daniel >> Friesen wrote: >> >>> Ok, narrowed it down. >>> Someone tells me that Konqueror isn't working for that page either so it >>> looks like IE8 and Konqueror may share this behavior. >>> From the looks of it $button.append( "[" ); is working. >>> >>> $('#bodyContent').append( "[" ); // works >>> $('#bodyContent').append( "[", "]" ); // "Invalid argument" in IE8 console, >>> works in FF Firebug console >>> $('#bodyContent').append( "asdf", "asdf" ); // "Invalid argument" in IE8 >>> console, works in FF Firebug console >>> $('#bodyContent').append( document.createTextNode("["), "]" ); // works >>> $('#bodyContent').append( "foo", "]" ); // in IE8 console only >>> inserts the ']' the foo span is not inserted, works in FF Firebug console >>> $('#bodyContent').append( "asdf", "qwerty" ); // >>> in IE8 console only inserts the qwerty span the asdf span is not inserted, >>> works in FF Firebug console >>> >>> So this looks like an IE8 (maybe Konqueror) issue where when .domManip >>> is used (by something like .append) with more than one argument with the >>> first being a string a "Invalid argument" error is thrown if the first >>> argument is not a valid node string. If the first argument is a valid >>> node string, instead the first argument is ignored and the rest are >>> inserted. >>> >>> ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name] >>> >>> John Resig wrote: >>> You say that you still have problems if you split apart the query. So in this case $button.append( "[" ) fails - correct? What happens if you do: $button.append( document.createTextNode("[") ) --John On Mon, Jun 22, 2009 at 2:09 PM, Daniel Friesen wrote: > I've been having trouble with a bit of jQuery that works in FF, Opera, > and Midori, but breaks in IE. > > See http://animanga.wikia.com/wiki/Sandbox?allinone=0 > The code: http://dev.wikia.com/wiki/ShowHide/code.js > (it's on a wiki, so you can see the history of editing) > > Using IE8's debugger tools (yay, finally MS rips of Firebug to give us a > way to find out why IE is breaking /sarcasm) I've narrowed it down to > $button.append( '[', $buttonLink, ']' ); Where jQuery's .append calls > .clean which near the end calls fragment.appendChild( ret[i] ); fragment > is the document, and i is 0, ret is 3 items in length containing the > text node, span, and other text node. jQuery tries to appendChild to the > document and IE decides it doesn't like it. > > Does this seem like a jQuery bug? > > Note: ya, I have tried splitting the append call into three separate > ones, still causes the same issue on the first one. > > -- > ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name] > > > > >> >> > >> > > > > --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to jquery-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en -~--~~~~--~~--~--~---
[jquery-dev] Re: IE issue with .append?
I ran into another IE issue with unclosed tag syntax inside node creation (I personally like to leave the / out unless necessary most of the time, especially since it flows fairly nice with .text(userVar)). http://jsbin.com/ejote All work in ie7, ie8, opera, firefox, and midori. However: Fail in ie7 and ie8 while they work in firefox, midori, and opera. Filed as: http://dev.jquery.com/ticket/4806 ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name] John Resig wrote: > This is very helpful analysis. I've added it to my todo list. Could > you file a ticket with your test cases, as well? Thanks! > http://dev.jquery.com/newticket > > --John > > > > On Mon, Jun 22, 2009 at 4:33 PM, Daniel > Friesen wrote: > >> Ok, narrowed it down. >> Someone tells me that Konqueror isn't working for that page either so it >> looks like IE8 and Konqueror may share this behavior. >> From the looks of it $button.append( "[" ); is working. >> >> $('#bodyContent').append( "[" ); // works >> $('#bodyContent').append( "[", "]" ); // "Invalid argument" in IE8 console, >> works in FF Firebug console >> $('#bodyContent').append( "asdf", "asdf" ); // "Invalid argument" in IE8 >> console, works in FF Firebug console >> $('#bodyContent').append( document.createTextNode("["), "]" ); // works >> $('#bodyContent').append( "foo", "]" ); // in IE8 console only >> inserts the ']' the foo span is not inserted, works in FF Firebug console >> $('#bodyContent').append( "asdf", "qwerty" ); // >> in IE8 console only inserts the qwerty span the asdf span is not inserted, >> works in FF Firebug console >> >> So this looks like an IE8 (maybe Konqueror) issue where when .domManip >> is used (by something like .append) with more than one argument with the >> first being a string a "Invalid argument" error is thrown if the first >> argument is not a valid node string. If the first argument is a valid >> node string, instead the first argument is ignored and the rest are >> inserted. >> >> ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name] >> >> John Resig wrote: >> >>> You say that you still have problems if you split apart the query. >>> >>> So in this case $button.append( "[" ) fails - correct? >>> >>> What happens if you do: >>> >>> $button.append( document.createTextNode("[") ) >>> >>> --John >>> >>> >>> >>> On Mon, Jun 22, 2009 at 2:09 PM, Daniel >>> Friesen wrote: >>> >>> I've been having trouble with a bit of jQuery that works in FF, Opera, and Midori, but breaks in IE. See http://animanga.wikia.com/wiki/Sandbox?allinone=0 The code: http://dev.wikia.com/wiki/ShowHide/code.js (it's on a wiki, so you can see the history of editing) Using IE8's debugger tools (yay, finally MS rips of Firebug to give us a way to find out why IE is breaking /sarcasm) I've narrowed it down to $button.append( '[', $buttonLink, ']' ); Where jQuery's .append calls .clean which near the end calls fragment.appendChild( ret[i] ); fragment is the document, and i is 0, ret is 3 items in length containing the text node, span, and other text node. jQuery tries to appendChild to the document and IE decides it doesn't like it. Does this seem like a jQuery bug? Note: ya, I have tried splitting the append call into three separate ones, still causes the same issue on the first one. -- ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name] > > > > --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to jquery-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en -~--~~~~--~~--~--~---
[jquery-dev] Re: IE issue with .append?
http://dev.jquery.com/ticket/4805 ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name] John Resig wrote: > This is very helpful analysis. I've added it to my todo list. Could > you file a ticket with your test cases, as well? Thanks! > http://dev.jquery.com/newticket > > --John > > > > On Mon, Jun 22, 2009 at 4:33 PM, Daniel > Friesen wrote: > >> Ok, narrowed it down. >> Someone tells me that Konqueror isn't working for that page either so it >> looks like IE8 and Konqueror may share this behavior. >> From the looks of it $button.append( "[" ); is working. >> >> $('#bodyContent').append( "[" ); // works >> $('#bodyContent').append( "[", "]" ); // "Invalid argument" in IE8 console, >> works in FF Firebug console >> $('#bodyContent').append( "asdf", "asdf" ); // "Invalid argument" in IE8 >> console, works in FF Firebug console >> $('#bodyContent').append( document.createTextNode("["), "]" ); // works >> $('#bodyContent').append( "foo", "]" ); // in IE8 console only >> inserts the ']' the foo span is not inserted, works in FF Firebug console >> $('#bodyContent').append( "asdf", "qwerty" ); // >> in IE8 console only inserts the qwerty span the asdf span is not inserted, >> works in FF Firebug console >> >> So this looks like an IE8 (maybe Konqueror) issue where when .domManip >> is used (by something like .append) with more than one argument with the >> first being a string a "Invalid argument" error is thrown if the first >> argument is not a valid node string. If the first argument is a valid >> node string, instead the first argument is ignored and the rest are >> inserted. >> >> ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name] >> >> John Resig wrote: >> >>> You say that you still have problems if you split apart the query. >>> >>> So in this case $button.append( "[" ) fails - correct? >>> >>> What happens if you do: >>> >>> $button.append( document.createTextNode("[") ) >>> >>> --John >>> >>> >>> >>> On Mon, Jun 22, 2009 at 2:09 PM, Daniel >>> Friesen wrote: >>> >>> I've been having trouble with a bit of jQuery that works in FF, Opera, and Midori, but breaks in IE. See http://animanga.wikia.com/wiki/Sandbox?allinone=0 The code: http://dev.wikia.com/wiki/ShowHide/code.js (it's on a wiki, so you can see the history of editing) Using IE8's debugger tools (yay, finally MS rips of Firebug to give us a way to find out why IE is breaking /sarcasm) I've narrowed it down to $button.append( '[', $buttonLink, ']' ); Where jQuery's .append calls .clean which near the end calls fragment.appendChild( ret[i] ); fragment is the document, and i is 0, ret is 3 items in length containing the text node, span, and other text node. jQuery tries to appendChild to the document and IE decides it doesn't like it. Does this seem like a jQuery bug? Note: ya, I have tried splitting the append call into three separate ones, still causes the same issue on the first one. -- ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name] > > > > --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to jquery-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en -~--~~~~--~~--~--~---
[jquery-dev] Re: IE issue with .append?
This is very helpful analysis. I've added it to my todo list. Could you file a ticket with your test cases, as well? Thanks! http://dev.jquery.com/newticket --John On Mon, Jun 22, 2009 at 4:33 PM, Daniel Friesen wrote: > > Ok, narrowed it down. > Someone tells me that Konqueror isn't working for that page either so it > looks like IE8 and Konqueror may share this behavior. > From the looks of it $button.append( "[" ); is working. > > $('#bodyContent').append( "[" ); // works > $('#bodyContent').append( "[", "]" ); // "Invalid argument" in IE8 console, > works in FF Firebug console > $('#bodyContent').append( "asdf", "asdf" ); // "Invalid argument" in IE8 > console, works in FF Firebug console > $('#bodyContent').append( document.createTextNode("["), "]" ); // works > $('#bodyContent').append( "foo", "]" ); // in IE8 console only > inserts the ']' the foo span is not inserted, works in FF Firebug console > $('#bodyContent').append( "asdf", "qwerty" ); // in > IE8 console only inserts the qwerty span the asdf span is not inserted, works > in FF Firebug console > > So this looks like an IE8 (maybe Konqueror) issue where when .domManip > is used (by something like .append) with more than one argument with the > first being a string a "Invalid argument" error is thrown if the first > argument is not a valid node string. If the first argument is a valid > node string, instead the first argument is ignored and the rest are > inserted. > > ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name] > > John Resig wrote: >> You say that you still have problems if you split apart the query. >> >> So in this case $button.append( "[" ) fails - correct? >> >> What happens if you do: >> >> $button.append( document.createTextNode("[") ) >> >> --John >> >> >> >> On Mon, Jun 22, 2009 at 2:09 PM, Daniel >> Friesen wrote: >> >>> I've been having trouble with a bit of jQuery that works in FF, Opera, >>> and Midori, but breaks in IE. >>> >>> See http://animanga.wikia.com/wiki/Sandbox?allinone=0 >>> The code: http://dev.wikia.com/wiki/ShowHide/code.js >>> (it's on a wiki, so you can see the history of editing) >>> >>> Using IE8's debugger tools (yay, finally MS rips of Firebug to give us a >>> way to find out why IE is breaking /sarcasm) I've narrowed it down to >>> $button.append( '[', $buttonLink, ']' ); Where jQuery's .append calls >>> .clean which near the end calls fragment.appendChild( ret[i] ); fragment >>> is the document, and i is 0, ret is 3 items in length containing the >>> text node, span, and other text node. jQuery tries to appendChild to the >>> document and IE decides it doesn't like it. >>> >>> Does this seem like a jQuery bug? >>> >>> Note: ya, I have tried splitting the append call into three separate >>> ones, still causes the same issue on the first one. >>> >>> -- >>> ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name] >>> >>> >>> >> >> > >> > > > > --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to jquery-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en -~--~~~~--~~--~--~---
[jquery-dev] Re: IE issue with .append?
Ok, narrowed it down. Someone tells me that Konqueror isn't working for that page either so it looks like IE8 and Konqueror may share this behavior. From the looks of it $button.append( "[" ); is working. $('#bodyContent').append( "[" ); // works $('#bodyContent').append( "[", "]" ); // "Invalid argument" in IE8 console, works in FF Firebug console $('#bodyContent').append( "asdf", "asdf" ); // "Invalid argument" in IE8 console, works in FF Firebug console $('#bodyContent').append( document.createTextNode("["), "]" ); // works $('#bodyContent').append( "foo", "]" ); // in IE8 console only inserts the ']' the foo span is not inserted, works in FF Firebug console $('#bodyContent').append( "asdf", "qwerty" ); // in IE8 console only inserts the qwerty span the asdf span is not inserted, works in FF Firebug console So this looks like an IE8 (maybe Konqueror) issue where when .domManip is used (by something like .append) with more than one argument with the first being a string a "Invalid argument" error is thrown if the first argument is not a valid node string. If the first argument is a valid node string, instead the first argument is ignored and the rest are inserted. ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name] John Resig wrote: > You say that you still have problems if you split apart the query. > > So in this case $button.append( "[" ) fails - correct? > > What happens if you do: > > $button.append( document.createTextNode("[") ) > > --John > > > > On Mon, Jun 22, 2009 at 2:09 PM, Daniel > Friesen wrote: > >> I've been having trouble with a bit of jQuery that works in FF, Opera, >> and Midori, but breaks in IE. >> >> See http://animanga.wikia.com/wiki/Sandbox?allinone=0 >> The code: http://dev.wikia.com/wiki/ShowHide/code.js >> (it's on a wiki, so you can see the history of editing) >> >> Using IE8's debugger tools (yay, finally MS rips of Firebug to give us a >> way to find out why IE is breaking /sarcasm) I've narrowed it down to >> $button.append( '[', $buttonLink, ']' ); Where jQuery's .append calls >> .clean which near the end calls fragment.appendChild( ret[i] ); fragment >> is the document, and i is 0, ret is 3 items in length containing the >> text node, span, and other text node. jQuery tries to appendChild to the >> document and IE decides it doesn't like it. >> >> Does this seem like a jQuery bug? >> >> Note: ya, I have tried splitting the append call into three separate >> ones, still causes the same issue on the first one. >> >> -- >> ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name] >> >> >> > > > > --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to jquery-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en -~--~~~~--~~--~--~---
[jquery-dev] Re: IE issue with .append?
You say that you still have problems if you split apart the query. So in this case $button.append( "[" ) fails - correct? What happens if you do: $button.append( document.createTextNode("[") ) --John On Mon, Jun 22, 2009 at 2:09 PM, Daniel Friesen wrote: > > I've been having trouble with a bit of jQuery that works in FF, Opera, > and Midori, but breaks in IE. > > See http://animanga.wikia.com/wiki/Sandbox?allinone=0 > The code: http://dev.wikia.com/wiki/ShowHide/code.js > (it's on a wiki, so you can see the history of editing) > > Using IE8's debugger tools (yay, finally MS rips of Firebug to give us a > way to find out why IE is breaking /sarcasm) I've narrowed it down to > $button.append( '[', $buttonLink, ']' ); Where jQuery's .append calls > .clean which near the end calls fragment.appendChild( ret[i] ); fragment > is the document, and i is 0, ret is 3 items in length containing the > text node, span, and other text node. jQuery tries to appendChild to the > document and IE decides it doesn't like it. > > Does this seem like a jQuery bug? > > Note: ya, I have tried splitting the append call into three separate > ones, still causes the same issue on the first one. > > -- > ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name] > > > > > --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to jquery-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en -~--~~~~--~~--~--~---