[jQuery] The $( exp, jQuery ) syntax is not working in 1.1
Love the new site. Don't mind the cleaned up API but I've got quite a lot of code that uses the $( expr, jQuery ) syntax and now it's not working. I haven't had time to wade through the code but check the following (with Firebug): spanOutside/span div spanInside/span /div console.log( $('span', $('div') ), $('span', $('div')[0] ) ); In jQuery 1.0.x they both (correctly) return [span], under 1.1 the first returns [span, span] while the second returns [span]. I believe this indicates that $() is not detecting the jQuery object as a context. Karl Rudd ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] The $( exp, jQuery ) syntax is not working in 1.1
On 1/15/07, Karl Rudd [EMAIL PROTECTED] wrote: Love the new site. Don't mind the cleaned up API but I've got quite a lot of code that uses the $( expr, jQuery ) syntax and now it's not working. I haven't had time to wade through the code but check the following (with Firebug): spanOutside/span div spanInside/span /div console.log( $('span', $('div') ), $('span', $('div')[0] ) ); In jQuery 1.0.x they both (correctly) return [span], under 1.1 the first returns [span, span] while the second returns [span]. I believe this indicates that $() is not detecting the jQuery object as a context. Karl Rudd Yeah, I also encountered this problem, so I had to use obj.find('aa') to replace $('aa', obj) -- I like python! UliPad The Python Editor: http://wiki.woodpecker.org.cn/moin/UliPad My Blog: http://www.donews.net/limodou ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] The $( exp, jQuery ) syntax is not working in 1.1
Hmmm that's all well and good but can someone please post a patch so that $/jQuery will work with a jQuery object as the context? That's how it's worked in the past and that's how the API reference says it works... Karl Rudd On 1/15/07, limodou [EMAIL PROTECTED] wrote: Yeah, I also encountered this problem, so I had to use obj.find('aa') to replace $('aa', obj) -- I like python! UliPad The Python Editor: http://wiki.woodpecker.org.cn/moin/UliPad My Blog: http://www.donews.net/limodou On 1/15/07, Karl Rudd [EMAIL PROTECTED] wrote: Love the new site. Don't mind the cleaned up API but I've got quite a lot of code that uses the $( expr, jQuery ) syntax and now it's not working. I haven't had time to wade through the code but check the following (with Firebug): spanOutside/span div spanInside/span /div console.log( $('span', $('div') ), $('span', $('div')[0] ) ); In jQuery 1.0.x they both (correctly) return [span], under 1.1 the first returns [span, span] while the second returns [span]. I believe this indicates that $() is not detecting the jQuery object as a context. Karl Rudd ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] The $( exp, jQuery ) syntax is not working in 1.1
Yeah, this is a bug. We should have a fix posted (aka 1.1.1) by this next weekend. --John On 1/15/07, Karl Rudd [EMAIL PROTECTED] wrote: Hmmm that's all well and good but can someone please post a patch so that $/jQuery will work with a jQuery object as the context? That's how it's worked in the past and that's how the API reference says it works... Karl Rudd On 1/15/07, limodou [EMAIL PROTECTED] wrote: Yeah, I also encountered this problem, so I had to use obj.find('aa') to replace $('aa', obj) -- I like python! UliPad The Python Editor: http://wiki.woodpecker.org.cn/moin/UliPad My Blog: http://www.donews.net/limodou On 1/15/07, Karl Rudd [EMAIL PROTECTED] wrote: Love the new site. Don't mind the cleaned up API but I've got quite a lot of code that uses the $( expr, jQuery ) syntax and now it's not working. I haven't had time to wade through the code but check the following (with Firebug): spanOutside/span div spanInside/span /div console.log( $('span', $('div') ), $('span', $('div')[0] ) ); In jQuery 1.0.x they both (correctly) return [span], under 1.1 the first returns [span, span] while the second returns [span]. I believe this indicates that $() is not detecting the jQuery object as a context. Karl Rudd ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] The $( exp, jQuery ) syntax is not working in 1.1
Thanks John. I should have looked in the bug tracker for the relevant bug ( http://jquery.com/dev/bugs/bug/804/ ). In the mean time I've added a temporary fix to my version. find: function( t, context ) { // Quickly handle non-string expressions if ( typeof t != string ) return [ t ]; //-- BEGIN FIX TILL 1.1.1 if ( context context.jquery ) context = context[0]; //-- END FIX TILL 1.1.1 // Make sure that the context is a DOM Element if ( context !context.nodeType ) context = null; Karl Rudd On 1/16/07, John Resig [EMAIL PROTECTED] wrote: Yeah, this is a bug. We should have a fix posted (aka 1.1.1) by this next weekend. --John On 1/15/07, Karl Rudd [EMAIL PROTECTED] wrote: Hmmm that's all well and good but can someone please post a patch so that $/jQuery will work with a jQuery object as the context? That's how it's worked in the past and that's how the API reference says it works... Karl Rudd On 1/15/07, limodou [EMAIL PROTECTED] wrote: Yeah, I also encountered this problem, so I had to use obj.find('aa') to replace $('aa', obj) -- I like python! UliPad The Python Editor: http://wiki.woodpecker.org.cn/moin/UliPad My Blog: http://www.donews.net/limodou On 1/15/07, Karl Rudd [EMAIL PROTECTED] wrote: Love the new site. Don't mind the cleaned up API but I've got quite a lot of code that uses the $( expr, jQuery ) syntax and now it's not working. I haven't had time to wade through the code but check the following (with Firebug): spanOutside/span div spanInside/span /div console.log( $('span', $('div') ), $('span', $('div')[0] ) ); In jQuery 1.0.x they both (correctly) return [span], under 1.1 the first returns [span, span] while the second returns [span]. I believe this indicates that $() is not detecting the jQuery object as a context. Karl Rudd ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/