Adding catch() method to jQuery deferred.promise.
I've read that jQuery 3.0 will support Promise/A+ spec but I've noticed that the catch() method is missing from the deferred.promise() object. Are there any plans to add catch() to deferred.promise ?
Proposal of an extension to jQuery core for async loading and module definition.
Hello friendly jQuery people! Please excuse this rather long mail. I'm writing on it and the docs for the better part of this day. (And excuse the word "mail" and the formating in the following. I thought there was a mailing list to post it to. Now I'm feeling a little old school while pasting it in here ;) Quicktip: There is documentation and code at https://github.com/ScheintodX/jqinit.js if you which to skip my writing and just have a peek. I'm the author of jqinit.js and would like to propose
Could jQuery.Callbacks fire() play safer when calling up the stacked callbacks?
Hello there, I had an issue which made me debug up to jQuery in order to figure out what was the issue. And with that, got me thinking about the current fire() implementation ( see it here: https://github.com/jquery/jquery/blob/1.x-master/src/callbacks.js#L72 ). Sorry for the long text ;P We use requirejs for module loading, therefore we might end with each module having it's own doc.ready trigger. No biggie as jQuery pile up the callbacks in an array and do a for(). Using requirejs means async loading
function augmentWidthOrHeight( elem, name, extra, isBorderBox ) causes continuous width decrease
On Firefox 33.0.3, with jQuery JavaScript Library v1.8.3, with RichFaces Core Implementation by JBoss by Red Hat, version 4.3.0.Final When moving the rich faces popup lef-right, the popup is shrinking continuously. <div style="position: absolute; z-index: 100; left: 299px; top: 74px; width: 815px;" id="xxxx" class="rf-pp-cntr "><div id="yyyyy" class="rf-pp-shdw" style="opacity: 0.1; left: 5px; top: 5px; bottom: -5px; width: 815px;">.. etc... On the background, the function augmentWidthOrHeight( elem,
jQuery.event.trigger() : Pass the "event" object as an argument to "elem[type]()" call
In function jQuery.event.trigger(), there is the following call (l. 4357 in jquery-2.1.1.js) : elem[ type ](); why not pass the event object as an argument ? This way : elem[ type ](event); This would provide the event object to the called function which is usually essential. In my case, this would allow to retrieve the namespace and thus adapt the action.
$.isJson(str);
Why do not implement this function, that already exists in Prototype.js ? I actually don't know how to implement the script on the core, so, here is the snippet. This script implements $(object).isJSON, $.isJSON(object) and [String].isJSON() functions Feel free to fix any bug. (function ($) { $.isJSON = function (json) { json = json.replace(/\\["\\\/bfnrtu]/g, '@'); json = json.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']'); json = json.replace(/(?:^|:|,)(?:\s*\[)+/g, '');
jquery.min.map cause 404 in jquery#1.10.2
I'm using jquery#1.10.2 from bower, because jQuery mobile requests this version. In the jquery.min.map, there is a "sources":["jquery-1.10.2.js"], which is not exist in the dir, and it'll cause a 404 error in console of Chrome's developer tools. Will you please change it to "sources":["jquery.js"] to prevent this error? Thanks!
$.text() feature request
I think it is nice to have wrapper for document.createTextNode('text'). It can be $.text('text') or even $('"text"') My current use case: var label = image.after(document.createTextNode('text')); will be var label = image.after($.text('text'));
bugfix for jquery-2.1.1 vendorPropName() - critical for my apps
function vendorPropName( style, name ) { // shortcut for names that are not vendor prefixed if ( name in style ) { return name; } // check for vendor prefixed names var capName = ( name==='' ? name // i have jQuery.css({bottom:''}) which are Necessary for my apps to run. : name[0].toUpperCase() + name.slice(1) ), origName = name, i = cssPrefixes.length; while ( i-- ) { name = cssPrefixes[ i ] + capName; if ( name in style ) { return name; } } return origName; }
findExclude(), a descending traversal method with functionality similar to parentsUntil
Hello, first time contributor looking for feedback. I ran into some issues where selectors were not the right tool for filtering nested elements and noticed a few cases of this around the internet. Primarily I see this in situations where people use $( selector ).each() for things like: Search within a container class which may have the same type of container nested within, as in my example with "Messages" - for form message threads. Searching by tag with nested ul/ol/table when each depth is meant
wish to be more intuitively object-oriented
i have started to use jQuery since the very first edition and i have read the code in detail of nealy all the versions of jQuery. The code is concise but not intuitively object-oriented enough. It must be a great help if we can make code more intuitively OO. And i think this idea will help us much. please refer to http://classjs.org which works to make js intuitively OO.
jquery bug
version:jquery2.0.3,the same to 2.1.1 var o = {}; o.n1 = o; console.log($.extend(true, true , {n2: o}));//or console.log($.extend(true, {}, {n2: o})); error:too much recursion
Suggestion: $(element).addTo(set)
I'd like to suggest an addTo() method, since jQuery often has two methods to do the same task but switching the context between source and target. For example, these could be equivalent: // Add to set using $.fn.add (function ($) { var $set = $('#a, #b, #c'); $set.add($('#d')); })(jQuery); // Add to set using $.fn.addTo (function ($) { var $set = $('#a, #b, #c'); $('#d').addTo($set); })(jQuery); Example implementation: $.fn.addTo = function (collection) { $(collection).add(this);
Difference in $.data between jQ1 and jQ2
jQ 1.11 camelizes keys added with $.data, while jQ2 does not camelize them: http://jsfiddle.net/trixta/6wAKJ/ Just wanted to ask wether this bug is already known? Can't believe it's unknown :-D.
Matchers and pseudos
Selector matching happens rtl, but I think there's a case to be made in the case of filters this isn't exactly best. Each part of the selector operates against an element and all of the simple selectors in CSS are, well, simple to check. Filters, however, don't have to be - the complexity of a filter is kinda N. Here's an example: .foo .thinger:_custom(.a .b:matches(.y:odd, span .x:even), .foobar) The filter above involves a lot of complexity. If the filter is subject as in the above case,
custom event doesn't bubbled up in IE 7-9
It's quite hard to describe, see the demo: http://jsfiddle.net/toobug/EsN5L/5/embedded/result/ (with the latest jQuery 1.x) http://jsfiddle.net/toobug/EsN5L/4/embedded/result/ (with jQuery 1.9.1) original code here http://fiddle.jshell.net/toobug/EsN5L/5/ (not compatible with IE) When the inner div is clicked, the outer should catch the custom1 event. It's all ok in Chrome, but in IE, if the click event of IE is bind with jQuery, it's ok, when the click event is bind with the built-in attachEvent,
mouseover and mouseout issue
Hi, I am working on a project on that when i mouse over on black dot - 1. navigation menu shown and when i mouseout menu hide (this is working properly) 2. When i click on that black dot my navigation menu animation load again(which is wrong) and menu content display But my navigation menu hide(which is need to show that navigation menu and menu content on click). 3. When i click on another navigation dot currently loaded menu and menu content need to be hide and display clickable dot menu and content.
Allow .html() to be used on Shadow DOM
The Shadow DOM currently allows for the .innerHTML property to be used to modify the HTML. Is it possible to add this functionality to the .html() method in jQuery?
What's the rationale of not exposing object's events handlers collections?
What's the rationale of not exposing object's events handlers collections? I've stumbled upon a situation where I wanted to pause all current transitions by registering all transitionend handlers, changing all properties to their current used values, pausing transitions (with forced style refresh afterwards so that it makes effect), running a custom callback and then restoring everything, including handlers. I know this particular case is probably not the most common one but there are cases when
Feature request: remove undelegated events without removing delegated
off() already supports the opposite of this To remove all delegated events from an element without removing non-delegated events, use the special value "**". How about enabling removal of non-delegated events without removing delegated by passing in null or an empty string as the selector? Here is my use case on page load my modal module attaches triggers using a delegated listener (to allow for lazy loading content into the page without having to worry about attaching new listeners) $('body').on('click.modal',
clone to copy form field values
This code snippet, when added to the clone() method copies form field values. Tested with IE 7 and FF 2 on Windows. // Copy .value and .checked attributes of form fields var dstFormElements = ret.find("*").andSelf().filter(":input"); if (dstFormElements.length > 0) { var srcFormElements = this.find("*").andSelf().filter(":input"); dstFormElements.each(function(i) { $ektron(this).val( srcFormElements.eq(i).val() );
X-XSS-Protection "1; mode=block" in Safari (4.x, 5.0) with jQuery 1.9.x redirects to "about:blank"
Hi there, in the ticket http://bugs.jquery.com/ticket/13546 (closed as "notabug") I described in comment 3-5 what caused this issue. This seems to be a bug in the XSS handling in WebKit. Does anyone here has some detailed information about how this works? I found nothing (I am interested in what is investigated when) and could only workaround by trying over and over again (and finally changing the line in jquery.js which does not feel right to me). I never encountered such an issue before but now
toggle(function)
$(selector).toggle(function) should be equivalent to $(selector).each(function() { $(this).toggle(function()); });
Find Performance between 1.7.1 and 1.9.x and 1.10.0
Hi, all... I recently updated the jQuery version my site is using to 1.9.1 from 1.7.1. Unfortunately, performance suffered considerably, especially in IE 9. I have a jsperf test that outlines what I'm seeing. http://jsperf.com/jquery-1-7-vs-1-9/2 $(".k-grid-content tbody:first").find('> tr:not(.k-grouping-row,.k-detail-row,.k-group-footer)') In Chrome, find using the query above is 66% slower in jQuery 1.9 and 1.10 than in jQuery 1.7. in IE, that same query is 92% slower in jQuery 1.9 and 1.10.
jQuery selector speed vs ExtJS
I visited page http://jsperf.com/mojo-of-dojo-and-jquery and noticed that selector of ExtJS are over 100 times faster. This is huge difference. Anybody know the source of difference?
"HEAD" and Commit ID showing inside my code
After creating a pull request, https://github.com/jquery/jquery/pull/1289 I see a two things I don't understand (lines 941 - 945 and 963 - 967): https://github.com/jquery/jquery/commit/51e0f62c239b12e90cd87a8a19980f954870fc49#L0R941 here: 941 +<<<<<<< HEAD <my code change> 945 +>>>>>>> 68178ff366b6e59f85ad772c0711f826b5b494ef and here, 963 +<<<<<<< HEAD <my code change> 967 +>>>>>>> 68178ff366b6e59f85ad772c0711f826b5b494ef That ID on 945 & 967 is a prior commit, https://github.com/jquery/jquery/commit/68178ff366b6e59f85ad772c0711f826b5b494ef
Official jQuery CDN does not support HTTPS
I installed the EFF's excellent [HTTPS Anywhere](https://www.eff.org/https-everywhere) plugin for my browser. I noticed that jQuery's official CDN, as listed in their docs, does not support HTTPS. You get a 504 error. It sure would be nice for such a large and popular project to "take a stand" and encourage HTTPS hosting of assets. I ended up going through Google's CDN, but it's just not the same.
Requesting a way to prepend an event handler
Hi, I'm reposting this from http://forum.jquery.com/topic/requesting-a-way-to-prepend-an-event-handler, which did not get any responses. It appears that all of the event handler adding functions (on(), one(), etc) append to the list of handlers. This can make it difficult to override other handlers that are already registered. Could jQuery add a way to prepend to the handler list? My use case is that I am creating a separate implementation of this jQuery-based drag/drop library: http://threedubmedia.com/code/event/drag
More exact use of the Slider
On smaller screens or sliders, it is not easy to pinpoint a slider value. You may say that it is not meant for that. However, I would argue that it could well be used for that with a modification. Here is an example: Before: Slide the slider to where you want to be. The feedback may show a number like '50'. Lift your finger. The feedback now changes to '49' or anything but '50'. Result: :-( After the mod: Slide the slider to where you want to be. The feedback may show a number like '50'. Keep
How can I contribute to jQuery Mobile core development?
Hi friends, I have extensively used jQuery Mobile API for my own developments and wanted to give something in return to its Community so I would like to join the jQuery Core team as a volunteer developer. I have checked the project's GitHub page and could not find which is the process I should follow or who I should contact with, I already have a GitHub account that I would use for logging into the repo. Can someone give me a hint on this? Is there any place in the GitHub wiki wehere I can find how
How can i edit and develope the core code?
Hi, I wanna contribute in the core development. So, i started to read the documents but i got confused and i have some important questions : Which IDE should i use for coding? How can i be one of the contributor? because my name is not between the contributor of core.js . How should i apply for being a contributor ? Please, introduce me a helpful document that guide me step by step for know how can i contribute,edit,develop and publish codes. Thank you
Abort request on ajaxSend breaks ajaxStart and ajaxStop
Hi, After call jqXHR.abort() inside ajaxSend, ajaxStart does not fire anymore. An silent exception is thrown in line 7986 of jQuery 1.8.3: try { state = 1; transport.send( requestHeaders, done ); } catch (e) { ... } transport is undefined.
$.proxy
Hi, as stated here http://api.jquery.com/jQuery.proxy/ additionalArguments Type: Anything Any number of arguments to be passed to the function referenced in the function argument. I understand ... the arguments are added after (additional) the already existing ones, i.e. var fn = $.proxy(function(a, b, c, extra) { alert(a + ' ' + b + ' ' + c + ' ' + extra); }, this, 'x'); fn('a', 'b', 'c'); I would expect to see the alert box with 'a b c x' inside, but I get 'x a b c' because the additionalArguments
Save the jQuery factory, reuse it in frames, no 2nd network request
Yes, there are those who hate frames with all their souls. If you're one of them, you probably won't like this idea at all. But if part of the page never or rarely changes, and you think frames make sense in that situation, you probably won't reject this idea on religious grounds. Terminology: The jQuery script tag doesn't contain jQuery. It contains the jQuery factory, which looks like this: (function( window, undefined ) { ... var ... // Use the correct document accordingly
Jquery.find in event.handlers is much slower than old quickIs
http://jsperf.com/jquery-1-7-2-quickis-vs-jquery-1-9-1-find With jquery 1.9.1 scroll on ios becomes very laggy because of event handlers of touchstart and touchmove bounded to document.body. Patching jquery with old quickIs resolve this problem. Is it possible to return quickIs in addition to current mechanic?
Incorrect instruction for building jQuery
I followed by this HOWTO link to build jQuery on my machine (Win 2008R2 x64), but when it comes to executing cd jquery && npm installit throws me the following exception in Bash cmd line: $ cd jquery && npm install module.js:340 throw err; ^ Error: Cannot find module '\\node_modules\npm\bin\npm-cli.js' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Function.Module.runMain (module.js:497:10) at startup (node.js:119:16)
jQuery() vs this.constructor()?
I noticed a few places (init, pushStack, end) in core.js where this.constructor() is used instead of jQuery() which is used throughout the rest of the library. Is there a reason for this? As I understand it this.constructor() is always a reference to jQuery(), is there any situation where that would not be true?
what does “Support: Firefox 18+” mean in jQuery1.9.1 source code?
I'm reading jquery1.9.1 source code. At the beginning, it says: // Can't do this because several apps including ASP.NET trace // the stack via arguments.caller.callee and Firefox dies if // you try to trace through "use strict" call chains. (#13335) // Support: Firefox 18+ //"use strict"; I've read ticket #13335 saying because of apps like ASP.NET trace call stack via arguments.caller.callee, "use strict" was removed. but I don't understand what "Support: Firefox 18+" means? Does it mean, if you
jquery html5 support?
I recommend future of jquery html5 support ===canvas Tag==== event -getContext -beginPath -arc -fillStyle -fill -stroke -more ===Video Tag==== event -play -stop -record -take photo -more ===audio Tag==== event -play -stop -record -more ==scroll value== -scrollheight -more ================
Bug of $(window).resize(function(e){}) in less then IE8
If in IE6\IE7\IE8,is will trigger $(window).resize enents when change DOM, In other browser,only if change browser`s window form size can tigger this events. is this a bug?
Next Page