Side navigation
#4143 closed bug (invalid)
Opened February 13, 2009 08:33AM UTC
Closed August 09, 2009 01:10AM UTC
http://www.gcforum.org/forumdisplay.php?fid=2410 can't not use jQuery selector to find elements??
Reported by: | Jumann | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.3.2 |
Component: | unfiled | Version: | 1.3.1 |
Keywords: | selector | Cc: | |
Blocked by: | Blocking: |
Description
as title.
I can't use jQuery selector to find html dom element.
example:
var body = jQuery('body');==> body.length will be 0; but get(0) will returned the element.
var wrap = jQuery('div#wrap', body); ==> wrap.length will be 0; but get(0) will returned undefined.
Is this a bug in jQuery 1.3.1???
Attachments (0)
Change History (6)
Changed February 14, 2009 01:13AM UTC by comment:1
resolution: | → worksforme |
---|---|
status: | new → closed |
Changed February 14, 2009 03:20AM UTC by comment:2
resolution: | worksforme |
---|---|
status: | closed → reopened |
javascript:(function(){window.t=document.createElement('script');window.t.src='http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js';window.document.body.appendChild(window.t);setTimeout(function(){alert(jQuery('body').length);},2000)})();
You can copy the sentence above here. Then link to http://www.gcforum.org/forumdisplay.php?fid=2410 and paste it to address bar.
It both returned 0 in FF3 and IE7. Thanks for your reply.
Changed February 14, 2009 06:15PM UTC by comment:3
It sounds like some other code on that page is interfering with jQuery. I couldn't see it in a quick look at common.js where I figured it would be. So, if you can create a simple test case that demonstrates the problem, attach it. If you need help debugging the code, it would be best to post on a forum because we haven't yet established this is a bug in jQuery. A simple test case would help to determine that.
Changed February 18, 2009 10:20AM UTC by comment:4
I found commom.js overrides Array.prototype.push function.
Array.prototype.push = function(value) { this[this.length] = value; return this.length; }
It seems that affects result of "ret.push( array[i] )". (at 2026 line of jQuery1.3.1.js)
It caused jQuery('body');==> body.length will be 0;
Does that problem resemble #2721?
Changed February 23, 2009 03:41AM UTC by comment:5
I found commom.js overrides Array.prototype.push function.
Array.prototype.push = function(value) { this[this.length] = value; return this.length; }
It seems that affects result of "ret.push( array[i] )". (at 2026 line of jQuery1.3.1.js) It caused jQuery('body');==> body.length will be 0; Does that problem resemble #2721?
Changed August 09, 2009 01:10AM UTC by comment:6
resolution: | → invalid |
---|---|
status: | reopened → closed |
Sounds like this was a problem outside jQuery.
That would be pretty obvious if it didn't work. I tried
with 1.3.1 and 1.2.6 in FF3 and IE7 and they both returned 1 as they should. If you can create a simple test case, attach it.