Possible jQuery bug with iPhone Safari
I have a problem with the animate function in Safari on iPhone 3.1.2. If I click a div with id #link, that has a click handler like this: $('#link').click(function(){ $('html,body').animate({scrollTop:$('#bottom').offset().top},5000); }); Instead of animating from the current scrollposition to the #bottom, it always starts from the top. If I want it to scroll from bottom to top, it just jumps directly to the top without animating, with this code: $('#link2').click(function(){ $('html,body').animate({scrollTop:0},5000);
calling $() with new String()
$(new String("button")).get(); /* returns b,u,t,t,o,n */ This (ridiculous?) $() call is it seems easy to avoid by replacing (jQuery.1.9.1.js line 132): // Handle HTML strings if ( typeof selector === "string" ) { With this : // Handle HTML strings if ( jQuery.type(selector) === "string" ) {I can't think of any other use case for this change to be perhaps necessary. Please discuss. --DBJ
feature request: debounced resize event
People designing responsive sites drag their windows wide and narrow like mad accordionists! But Doing this without debouncing the resize event can causes chaos in the console. So I use a debounced resize event on almost every single page I ever design. Louis Remi's longstanding solution: https://github.com/louisremi/jquery-smartresize is a good candidate for canonization into core, in my humble opinion, possibly streamlined slightly. It's not a "plug-in" really, it's a abstraction to resolve a persistent
.keypress vs .keydown Description on the jQuery API Documentation
I built a textarea length monitor a while back, and when I was doing it, I used the API documentation which said, and still says, that .keydown only fires once if a key is pressed and held down. If I want my monitor to update as the key is held down (every time a character is added), I'd need to use .keypress. I was testing this in IE10 today and found that .keypress only works for inserting characters on IE. Pressing backspace or delete doesn't fire the event. (Those keys do fire it in FF/Chrome).
Confusion of "Anything" vs "Object" in documentation
What is the distinction between type "Anything" vs "Object" in documentation?For example: The args in deferred.resolve( args ) is Object. The data in .on( events [, selector ] [, data ], handler(eventObject) ) is Anything. Can we just use one name if there is no real different? I can make a pull request if you agree using only one of them.
An advanced selector request $.level()
I was thinking on a tool that would make people's life easier by making a recursive search of elements and give us the deepest level when plainly used. Level 0 <div id="test"> Level 1 <div> Level 2 <div class="third"> Level 3 <div> Level 4 </div> </div> </div> </div> It should return level count when no index is given; $("#test").level(); // Which should
Are there plans for Sizzle 2.0 dropping oldIE?
Since jQuery already has two versions, one of them dropping oldIE, wouldn't it be good to also create a separate Sizzle 2.0 version dropping oldIE? Regards, Michał Gołębiowski
jQuery out of policy error
Isn't it the purpose of JQuery make life easier and more productive? To me the very main principal reason of Jquery core is solving problems about compatibility, but of course there is much more in it than that. Based on this, I agree if JQuery in some cases needs to make some things , lets say, more complex or difficult to code in pro of the compatibility, but ... (now the case) Why this rule? If you wish to use any of the meta-characters ( such as !"#$%&'()*+,./:;?@[\]`{|}~ ) as a literal part
modifying $.when() behavior?
hey guys, currently $.when() behaves similarly to Q.spread() https://github.com/kriskowal/q#combination when/apply https://github.com/cujojs/when/blob/master/docs/api.md#whenapply that is...the results of multiple promises are passed to the done/fail/progress callbacks via .apply(this, resolvedValues). Most other .all() implementations (Q.all, when.all, RSVP.all) opt to do this via .call(this, resolvedValues), resuting in an single resolvedValues argument passed to the callback rather than as separate
jQuery version support
The company I work for is fairly conservative to the utilization of open-source software due to not having the same "support blame" model that the big-house shops do when utilizing their software (IBM, etc). I was able to bring in jQuery for our company a few years ago, but having trouble selling the need to stay up-to-date on releases (due to upgrade/testing effort involved). How would you describe the support model to management in relating to the statement "v. 1.4.2 should be upgraded to the
Selecting first child - plugin perfomance
In an answer to a Stack Overflow question I enumerated all the ways I knew to get the "first children" of a jQuery object. I had originally suggested that .children().first() wouldn't be very efficient because it requires jQuery to first build the list of all children, and then create a new jQuery object that only contains the first element. So I wrote a plugin which uses .firstElementChild if available or iterates over the children directly otherwise. In the former case the plugin effectively becomes:
add a 'loaded' event to .on() method
Right now, if you want to manipulate dynamically loaded as well as static elements, it's necessary to use .on( { 'DOMnodeInserted', function(){ $(this).css('color','#000'); } }, '#dynamicElement' ); $('#staticElement').trigger('DOMnodeInserted'); But it would be iffy, since DOMnodeInserted is not consistently supported, and static elements require a .trigger() It would be nice to be able to simply utilize a generic "load"
Selector bug with input and attribute on version 1.9.x
Hello devs, Here is my simple html: <html> <head> <script src="http://code.jquery.com/jquery-1.9.0.min.js"></script> </head> <body> <form id="myForm"> <input value="" name="test" /> </form> <body> </html>When I load my page the first time, my input has no value, so when I query that way: $('#myForm :text[value][value!=""]') No input matchs which is correct. But when I manually enter a value in the input after pageload and I query the same way, it should
Removing the PHP test dependency
jQuery's test suite currently relies upon a PHP server. Has there been any discussion of using node for the server? Seeing as the development process already uses node.js it seems like that would be preferable. The code to serve up static files (here's one example) is pretty straight forward.
Selectors API Level 1
Hi, everybody. This is a site from Terra Informatica: http://www.terrainformatica.com/ W3C: “Selectors API Level 1″ is out but …Can somebody confirm if is useful for JQuery? Thanks.
A question about display of persistent toolbars in changing screen orientation
Using the defualt browser of android mobile opens the example of 'jquery.mobile-1.2.0\demos\docs\toolbars/footer-persist-a.html' and changing screen orientation from vertical to horizontal then from horizontal to vertical,The results are as follows:
feature req: .until()
I was wondering if it's feasible to add an "until()" method that is identical to the existing "prevUntil" and "nextUntil", except it will determine the direction to traverse for you based on the index of the supplied parameter. I realize this may get a little complicated when passing a jquery object or selector that has multiple matches, in which case I'd imagine it would use the first result. Furthermore, an "untilAfter()" that the same as the proposed "until()" but also includes the parameter
Online tools for extracting only required modules from core jQuery
Hi Team! I gone through the process of extracting the required modules from core jQuery. But found difficult to use it. Can we have (1): an online tool where all the modules from core jQuery listed at one place each modules will have checkbox next to it after selecting some modules, user will be able to export those modules WITH their dependent functions so that user will visually get ONLY required modules in minified form Or can we have (2): an online tool where all the modules from core jQuery
replaceWith bug?
Hi, replaceWith does not seem to work anymore with text nodes in jQuery 1.9 textnode.replaceWith('some content'); does nothing; I can see the text node content with alert(textnode.text()); Sample code: <div id="nodes"> text node <a href="#" title="Some link">some link</a> other text </div> $('#nodes').contents().each(function(){ alert($(this).text()); $(this).replaceWith('replaced!'); }); see jsfiddle Any ideea?
offline documentation is unavailable
Hello, now it's impossible to download jQuery offline documentation. Previously offline documentation was available at the http://api.jquery.com/api . Thanks, Sergey
JSONP unit test failing with REST-like callback
Hi, I'm just starting with trying to contribute to jQuery, so the first thing I did was to setup the unit testing environment. I setup nginx, PHP5 and FastCGI. What I did exactly can be read here: http://www.iovene.com/996/ I'm running tests against the current git master (bfc61b879e9e94ef7c6b31919b7f287ffdf180a8), and I have 6 failing. One is "JSON results returned (GET, REST-like)". The reason seems to be that the unit tests makes an AJAX request to http://localhost/test/data/jsonp.php/jQuery2000971086542820558_1359025716914?_=1359025716915
Regression in 1.9.0 from 1.8.3 related to namespaced events
Hi, If en event gets triggered like this - `$.event.trigger('myEvent.mySpace');` then previously it was possible to listen to this event by binding, for example, `$(document).bind('myEvent.mySpace', ...)` and `$(document).bind('myEvent', ...)`. This fails after updating to jQuery 1.9 (or 2.0 beta), see this simple demo - http://jsfiddle.net/NnWNL/ - there are two alerts when using older versions and only one with the latest.
Passing hash to $.fn.toggleClass
Similar to .attr and .prop $('body').toggleClass({ editable: true, allowThing: false })
Wrong animation initial value calculation
I already reported this bug 6 days ago when tested first beta of jQuery 1.9 - http://bugs.jquery.com/ticket/13183 Unfortunately, v1.9 come out today and there were no updates and my script is broken. Any ideas when/if this is going to be fixed?
sliding elements inside inline-block container are poor in Chrome
When an inline-block contains a sliding element it works very poorly in Chrome. Makes the whole container wobble around. Works smoothly in Firefox.
.ajax() fail when you click in a[href]
I posted it into bugs page, but dmethvin told that I need post here before. So, here I'm. Original post: Well... If you have a a[href^="abc:"] element then you click on it the browser will start a new request, but this pattern will do not execute anything, so you will stand on the same page. Take a look: http://jsfiddle.net/ZwYYT/ If you start an .ajax() request and .click() in this element, you will have an error, because your Ajax request will be aborted by browser. The problem is that jQuery
jQuery.now() to comply with the "High Resolution Time" API.
jQuery.now() is a useful function. It can be more useful. I would add a boolean operator that will allow to change the default behavior ( (new Date).getTime() ) to be performance.now() as per the High Resolution Time W3C Recommendation. What do you think?
dist/jquery.js: Non-ASCII characters detected on Window 7.
How can I fix it? D:\Code\github\jquery> grunt path.existsSync is now called `fs.existsSync`. Running "submodules" task Running "selector:src/selector.js" (selector) task File 'src/selector.js' created. Running "build:dist/jquery.js:*" (build) task File 'dist/jquery.js' created. Running "lint:dist" (lint) task Lint free. Running "lint:grunt" (lint) task Lint free. Running "lint:tests" (lint) task Lint free. Running "min:dist/jquery.min.js" (min) task File "dist/jquery.min.js" created. Uncompressed
When will be a good time to start reporting bugs & pull requests to jQuery 2.0?
I'm quite interested in a good quality of jQuery 2.0, especially that I'm happy enough to recently work mostly on projects not supporting IE<9. I wish to know when will be a good time to start tracking potential bugs and report pull requests to the code base? I'm asking because work on this version seems to just have started and I wouldn't like to duplicate your in-progress effort.
Can't build jQuery on OS X 10.8.2
Starting some time ago I can't build jQuery on OS X 10.8.2. It happened when master was on 1.9.0pre and it happens now when it's 2.0.0pre. If I follow instructions and run: $ npm install $ gruntI get an error: <FATAL> Unable to find "grunt.js" config file. Do you need any --help? </FATAL>Next, I tried to provide a config file (though it probably means README.md should be corrected): $ grunt --config Gruntfile.jsbut then I get this: Running "update_submodules" task Running "selector:src/selector.js"
Sorry, a duplicate topic (can be removed).
Sorry, a duplicate topic.
$('input').attr('type', newVal) SHOULD throw in ALL browsers.
jQuery is here to normalize browser differences. If jQuery 1.9 supports oldIE, changing input type should throw in all browsers for consistency. I think the initial intuition here was correct. If you want to change input type without having an error thrown in modern browsers, you can just drop down to regular javascript and use .setAttribute('type' .. RIGHT?
querySelectorAll and getElementsByClassName
Are there plans to use native browser .querySelectorAll() and .getElementsByClassName() in future releases? .getElementsByClassName() works just as described and will be in upcoming WebKit and Mozilla releases (it's in FF3, which should come out this quarter). I haven't looked at any Firefox benchmarks, but the native Webkit implementation is blazing fast: http://webkit.org/blog/153/webkit-gets-native-getelementsbyclassname/ .querySelectorAll() is much more exciting; it's in the W3C selectors API
will immediate child selector be deprecated?
there is a note on: http://api.jquery.com/child-selector/ Note: The $("> elem", context) selector will be deprecated in a future release. Its usage is thus discouraged in lieu of using alternative selectors. I need this feature and in irc channel i got another solution: context.find(">elem") What i am wondering is since $(selector,context) won't be deprecated(will it?) and ">elem" can be used in .find(), why $(">elem",context) will be deprecated? Thank you~
click even firing difference between 1.8.0 and 1.8.1/1.8.2
I am having problem with click event. It fires if I use 1.8.0 but does not when 1.8.1 or 1.8.2 is used. I am using jQuery with Backbone and jQuery Mobile framework. I am not sure if the problem is related with these but I was able to narrow it to the following lines: for 1.8.0 it's between lines 3009-3039 for 1.8.1 it's between lines 3013-3043 it (1.8.0) has changed from selMatch[ sel ] = jqcur.is( sel ); (line 3030) to this (1.8.1) selMatch[ sel ] = jQuery( sel, this ).index( cur ) >= 0; (line
:hidden selector
Hi guys, just came across an issue when using $('img').is(':hidden') - it returns true if its the first time I am loading a page with an image. Because it wasn't cached yet. But in documentation it is saying that Elements can be considered hidden for several reasons: They have a CSS display value of none. They are form elements with type="hidden". Their width and height are explicitly set to 0. An ancestor element is hidden, so the element is not shown on the page. the image does not satisfy any
Should qunit be updated by update_submodules?
I've followed the instructions in the jQuery readme to clone the jQuery repo and build it with Grunt. When trying to check the unit tests at test/index.html, I discovered that qunit/qunit/qunit.js was missing. I eventually noticed the qunit submodule needed to be initialized and pulled. I was wondering whether that process should have happened automatically as a result of the Grunt update_submodules task. That task did update the sizzle submodule, so I would have expected it to also update the qunit
Why not add timer functionality to the core?
It seems to be that jQuery is all about taking what you can already do in JS in browsers, and wrapping it to make it a lot easier. To that end, timer functionality would seem to be an ideal thing to add to the jQuery core. You could have named timers, or timers associated with individual DOM elements. I could just refer to a timer by name, for example: $.timer("redCountdown").start(); $.timer("redCountdown").changeInterval(123); $.timer("redCountdown").stop(); Or have a timer associated with DOM
replace the $.browser(.webkit/ ...) deprecied by my idea
hi, i have a idea $.browser = {extension : '', mozilla : false, webkit : false, khtml : false, opera : false, microsoft : false}; if ($(body).css('-moz-user-select') !== undefined) { $.browser.mozilla = true; $.browser.extension = "-moz-"; } else if ($(body).css('-webkit-user-select') !== undefined) { $.browser.webkit = true; $.browser.extension = "-webkit-"; } else if ($(body).css('-khtml-user-select') !== undefined) { $.browser.khtml = true; $.browser.extension
Optimize jQuery.expr.filters.hidden
Hi, Wouldn't it make sense to alter the order of the expressions in jQuery.expr.filters.hidden to only do the expensive work (elem.offsetWidth) after evaluating the parts that don't trigger a reflow? In the case the element is determined to be hidden by the style, it does not trigger a reflow anymore, what would be a nice behavior for a hidden element. So instead of return ( elem.offsetWidth === 0 && elem.offsetHeight === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display)
Next Page