sizzle

jQuery selector bug? composed selector vs. simple selector & find()

旧街凉风 提交于 2019-12-12 09:57:28
问题 Something is very awkward about my situation... i have something like this: <div id="selector"> <input type='radio' /> <input type='radio' /> <input type='radio' /> </div> if I use $("#selector input[type=radio]") all three elements are found, but if I use $("#selector").find("input[type=radio]") or even find("input") only the first one is found. Is this a bug in jQuery? Am I not using find() properly? Clarification : I want to use find() to get all the inputs, but anything I try finds only

JQuery 1.7.1 seemingly can't handle HTML5 element IDs

百般思念 提交于 2019-12-10 15:35:46
问题 As you may be aware, HTML5 allows more characters to be used in ID names - see the HTML5 spec which now has space as the only invalid character. Attempting to use this with JQuery shows JQuery ignoring all characters in the ID after a particular valid character, '/'. <section> <div id='foo/bar'> YAAY </div> <div id='foo'> BOO </div> </section> ​ Logging the 'foo/bar' element console.log(​$(document).find('div#foo/bar')​​​​)​ Shows the incorrect element being returned: [ <div id=​"foo">​ BOO ​

replace dojo.query with Sizzle?

两盒软妹~` 提交于 2019-12-10 11:05:48
问题 Dojo has got the slowest selectors compared to other JS frameworks. I was wondering if it was possible to use Sizzle within Dojo to make dojo.query use it behind the scenes? I think it is used in jQuery that way, so it should be possible in Dojo too. Couldn't find any info about how to do that. PS The test at the link seems to be being actively developed and changes daily, so make sure you select the latest version on that page. EDIT: it appeared that the numbers in the test were not correct,

Using jQuery to select elements with data attributes assigns a null ID to its parent elements

一曲冷凌霜 提交于 2019-12-10 09:52:08
问题 This is truly bizarre. If I use jQuery's .find() to find child elements that have data attributes during a scroll event, then scrolling the page will repeatedly add and remove an ID to the parents of those elements. It's difficult to describe, but here's a reproducible test case: http://jsfiddle.net/8fouvx9p/ var groups = $(".group"); $(window).bind("scroll resize orientationchange", function() { showGroup(); }); function showGroup() { $(groups).each(function() { var group = $(this), elements

Weird issue in IE7 Only not in any other browser

烈酒焚心 提交于 2019-12-10 04:19:36
问题 It is a simple HTML , i have jquery-ui(1.10) and jquery (1.9.1) . it works fine in IE8,9 ,firefox and in chrome only in IE 7 HTML has something like below. I have no idea what that is and where that is from this piece of code is not there when i see this HTML in IE8,9 , Firefox and chrome sizzle-1367496452938="[object Object] and all the div tags injected with this jQuery191030626454110549073="6" Here is some part of the html look like this.Anyone knows what is this issue is? <html sizzle

Can I force jQuery to use Sizzle to evaluate a selector without using non-standard selectors?

筅森魡賤 提交于 2019-12-10 04:19:33
问题 In modern browsers, jQuery makes use of document.querySelectorAll() to boost performance when valid CSS selectors are used. It falls back to Sizzle if a browser doesn't support the selector or the document.querySelectorAll() method. However, I'd like to always use Sizzle instead of the native implementation when debugging a custom selector. Namely, I'm trying to come up with an implementation of :nth-last-child() , one of the CSS3 selectors that are not supported by jQuery. Since this

Get iframe contents with a jquery selector

南笙酒味 提交于 2019-12-10 02:56:07
问题 Is there anyway to access an iframe's contents via a selector? Something like this: $("iframe::contents .my-foo") I'm constantly accessing an iframe's contents for a project I'm currently working on and $("iframe").contents().find(".my-foo") is becoming a bit tedious to type out. If this feature doesn't exist in jquery out of the box, is there a plugin that provides this functionality? If not how could I write such a plugin? 回答1: I had this issue once where I found it tedious. I never found a

jQuery Syntax error, unrecognized expression: [name=Basics.Gender]

孤者浪人 提交于 2019-12-08 15:24:37
问题 I am upgrading from jQuery 1.4.4 to jQuery 1.7.2 and I get a syntax error. I think its due to the '.' in the Basics.Gender part of the selector. $('[name=Basics.Gender]') Anyone have any suggestions on how to fix this? http://jsfiddle.net/2nBc9/ EDIT Anyone know why the '.' breaks the selector syntax now? Are they using regex's or something in Sizzle? Or has it always been best practice to put the attribute in quotes? 回答1: Quote the value: $('div[name="Basics.Gender"]') http://jsfiddle.net

How to get rid of sizset and sizcache attributes from jQuery?

六眼飞鱼酱① 提交于 2019-12-07 06:04:45
问题 I am already aware of what sizcache and sizset attributes are, but my concern is about their multiplication in our web application. I explain : We developed a "home brewed" WYSIWYG html editor using jQuery and when our users save the result HTML, we retrieve it with .html() (or innerHTML ) and then save it in the database. Then our users can edit it, and save back again in the database. When using non-IE browsers, everything is fine, BUT in IE, jQuery adds those (ahemm nasty) sizset and

replace dojo.query with Sizzle?

送分小仙女□ 提交于 2019-12-06 14:16:53
Dojo has got the slowest selectors compared to other JS frameworks . I was wondering if it was possible to use Sizzle within Dojo to make dojo.query use it behind the scenes? I think it is used in jQuery that way, so it should be possible in Dojo too. Couldn't find any info about how to do that. PS The test at the link seems to be being actively developed and changes daily, so make sure you select the latest version on that page. EDIT: it appeared that the numbers in the test were not correct, and the difference between Dojo and others is not really as radical. That makes the task of including