jQuery builder
Hi, I try to develop for a customer some WebWorkers to made some ajax request. The problem is that I can't load jQuery because it try to plug on the window object. And often, I use jQuery only for the DOM ready event and to send some Ajax requests (and use some utilities function, like isFunction, noop ...). Can we have a builder, where we can choose what part of the core we want to load (core, utilities, ajax, manipulation, transformation, animation ...) ? And this builder can have an option where
Not getting the appended hidden field and it's value
Hello, I am appending the hidden field using jquery append method to span tag but, it's not showing the appended hidden field and it's value.......
"grunt custom" doesn't work.
D:\Code\github\jquery [master]> grunt custom:+ajax,-dimensions,-effects,-offset path.existsSync is now called `fs.existsSync`. Running "custom:+ajax" (custom) task Creating custom build... Done, without errors. D:\Code\github\jquery [master]> cd .\dist ; ls 目录: D:\franckfang\Code\github\jquery\dist Mode LastWriteTime Length Name ---- ------------- ------ ---- -a--- 2012/10/14 17:57 0 .sizecache.json I don't know why there is nothing in
Who manages Authors.txt?
Just being nosy, how is that authors.txt kept up-to-date? There is a grunt-task for this "grunt authors", but it shows a much longer list. (arround 200 lines from the task and roughly 130 in the file) Furthermore it seems that some updates are done manually and others occur along with some closed pull-request. Is there some secret rule? e.g. "only users with a public email address in their profile". Just one sample: Sai Wong (committed lots of code on October 16th) is not in the authors list. Searching
And what is with JSON?
JSON found in many usage, as well as me. Thats nice about that getJSON or parseJSON a JSON string is converted to an object, but what about the other direction? Constantly (and especially if you are constantly working with JSON) you have to make sure that you use a reasonable parser - Because if you want to convert objects to JSON, one must necessarily use a plugin. Why is this not built into the core?
.promise() violates documented behaviour
Due to the documentation of .promise() the created Deferred object will resolve when all actions bound to the collection have ended. jQuery's implementation does not behave like that! (version 1.6 up to 1.8.2) The documentation still leaves space for two possible interpretations. Both are violated. Interpretation #1: For multiple elements the .promise() object resolves once all elements are not being animated at the same time. The minimal counter example for that meaning is: $('#foo').fadeOut(100);
.exitIntercept()
I'd like to submit my very simple solution/replacement for the deprecated .beforeunload() utility. jQuery.exitIntercept = function(e,msg) { var message = jQuery.trim(msg); e = e || window.event; if (e) { e.returnValue = message; } return message; } This small utility is IE/FF/Chrome/Safari safe. Thanks Usage: window.onbeforeunload = $.exitIntercept("You are attempting to leave this page with unsaved changes! If you leave this page without saving your changes, they will be lost!");
Proposal for Official .ScrollTo() Method
I wrote this .scrollTo() method to make scrolling much simpler. I hope it can be included in the next iterative release, as part of, jQuery's core library. I appreciate any feedback. API / Examples / Source: .scrollTo()
Why not make jQuery a core script engine to the browser without parsing it by JavaScript as a library?
I would like to know if the developers of jQuery ever considered the library to work like the V8 JavaScript engine rather than as a JavaScript library. Considering that everything is being re-done over and over by the next parser: myscript - jQuery (doing what myscript was trying to do, just the harder and longer way) - JavaScript (again repeating the same) - Browser (again..., to other underlying libraries) - OS that then eventually directs the entire machine on executing the command, which responds
__exposed_props__
My apologies if someone has already raised this (I couldn't find it with a search) but jQuery -- at least jQuery 1.7.1 which I am currently using -- apparently exposes properties without using __exposedProps__. Starting in Gecko 15.0 (Firefox 15.0 etc.), exposing functions or objects without using __exposedProps__ is deprecated. __exposedProps__ will be mandatory starting with Gecko 17.0. See https://developer.mozilla.org/en-US/docs/XPConnect_wrappers#__exposedProps__ for details. JM
New $.Callbacks object behavior
I've modified the private fire function of Callbacks object to recognize the string return value "remove". Each callback that return "remove" will removed of the current list. I don't know if it's the best way to do this, but it's an idea.
To chain or not to chain methods of the Callbacks Object?
Because it is tempting to use "undocumented internals that some people have cleverly reverse engineered", here is an observation. In jQuery 1.7 and 1.8, you can call in a chain 7 methods of the Callbacks Object which return this. http://jsfiddle.net/mpedrotti/uW82R/ Noticing this (pardon the pun ;-) I chained methods to set up callbacks for symmetric observers: publish = callbacks.add(subscribe).fire; // simplified example When I reviewed the API documentation this week, I noticed: * The pages for
.promise(type) doesn't work with non-default animation queues
Hi, On http://jsfiddle.net/creativecouple/3Y63M/ I have an example with .promise(type). There is one element animated (.delay) with the default queue 'fx' and the other one with another queue 'foo'. First question, informative: - Is it intended that non-default queues don't start on their own like 'fx' does? I always have to start it manually via .dequeue('foo'). Second question, the problem: - Why does .promise(type) don't wait for the non-default queue to finish? This is the same for any jQuery
Broken link in documentation portal
from main page, if you click on 'submit a new bug' ... the page report a 'my sql is gone away' error. I don't know if It's the right place to post, but... here I'm ...
loop through json inside json
I have a json collection, and inside each item I have other collection: I'm walking in the first json item: I need to walk inside an collection that exists inside the actual item. $.each(data, function (index, element) { var tmp = $('#itemBusca').html(); $('#buscas').append(_.template(tmp, element)); }); [{ "Codigo": "692547", "Afiliacao": "RS", "Nome": "155 HOTEL", "Provincia": "BRSAO", "NomeProvincia": "SAO PAULO", "Categoria": "3", "DataEntrada": "20120728",
Feature reques: toggle attribute
usecase: function onclick(){ if(expression == true){ $("#myselector").attr("checked","checked"); }else $("#myselecto").removeAttr("checked"); }So, maybe better add $("myselector").toggleAttr("checked","checked");
Performance issues using $.ajax async
Hello, I am using JQuery on a embedded system which use webkit as browser, i detect that jquery for asynchronously ajax calls use polling: 3620: var ival = setInterval(onreadystatechange, 13); instead of: xhr.onreadystatechange = onreadystatechange; for my scenary this has performance issues, i like to know why jquery use the first option when the second could be used. Thanks and sorry for my english. --
jQuery.version
jQuery.version and/or jQuery.version() (moved from guithub I think we are all in agreement here, and this is why I have tried to draft one VERY short proposal for a good jQuery team. In case they do agree with it, I am sure they will be perfectly capable to sort out the implementation details. Recap: 1. jQuery.version perhaps as an simple object, to be added 2. versioning tag composition documented in the form of the minimal grammar (BNF), to be made 3. Official plugin that will provide additional
A Case for Deferred.chain
As of today, Deferreds are awesome to deal with asynchronous tasks. However, they lack a mean to filter/chain tasks without cumbersome code. For instance, let's say you want to chain two ajax requests. Here is how you'd do it now: $.ajax( url ).done(function( response ) { $.ajax( reponse.url ).done( callback ); }); It gets a bit trickier when you need to give a promise for the end of the whole task in order to decouple the code and not have to provide the callback when the request is initiated
jQuery.forEach?
I noticed in the jQuery 1.5 Roadmap (psht, 1.4 is already old hat) a line that says "jQuery.forEach and deprecate jQuery.each". Is there any more info about that? I'd be interested to know what changes are proposed for each. Or is it just a reference to Classy Query?
Bug: jQuery.position() after css transform gives different result on Webkit & Firefox
Load the following page in Firefox (3.6+ or 4.0) and Chrome/Safari http://files.n2napps.com/bug-jquery-position-after-transition-webkit-firefox-different.html In Webkit browsers, the $box.position() take in account the css transform translate() operation, however in Firefox when we call after the css translate, the $box.position() return the same values than before the translate (even if the $box has been successfully translated) Here is the short code to illustrate this issue (but do a view source
jQuery.ajax()'s processData option extension
Let users use functions for the processData option for $.ajax() (more importantly for $.ajaxSetup() ) for more advanced handling of data. Here is what I've came up with: // Convert data if not already a string if ( s.data && s.processData && typeof s.data !== "string" ) { if (typeof s.processData === "function") { s.data = s.processData(s.data) }else{ s.data = jQuery.param( s.data, s.traditional ); } } What do you think?
Retrieving all attributes of a given element and their values.
jQuery appears to be missing a way to retrieve an array of attribute names for a given element, and to (optionally) retrieve their values at the same time. riddlemd has created two concise plugins to address this shortcoming - listAttributes and mapAttributes - but I think this functionality should be core, and ideally unified into a single function - perhaps called attrs() - which optionally retrieves a map rather than a list via an optional parameter, set to true for map, false for list... not
A couple of Sizzle micro-optimisations
First - there's a lot of testing whether typeof selector !== "string"(or whatever) - might be useful to define the strings "string", "undefined" etc. as a variable STRING, UNDEFINED - wouldn't make any difference to the code, but minifiers would find it useful, since they could create there own minified var. Would save a few bytes. Second - there's quite a lot of comparison to null and not-null - but usually == instead of ===. Either it's meant to be coerced (in which case just do !(whatever)) but
$.each(null,function(){}) error or purposed?
$.each(null,function(){}) gives a javascript error - is this an intended functionality? Seems a bit redundant to check for nulls before calling each. Works fine for $.each({},function(){}) and $.each([],function(){}) Just wondering
Chrome crashes on jQuery Test Suite #5
I'm trying to setup a dev environment for developing jQuery core, but Google Chrome (v10.0) crashes when I run the jQuery Test Suite (http://localhost/jquery/test). It seems to crash on '#5. core: browser' on both the 'master' and '1.6rc1' branches. Do you think this is a problem with my setup, a known issue, or should i file a bug? Additional Information: I followed the setup instructions on http://docs.jquery.com/Tips_for_jQuery_Bug_Patching and have MAMP, git, node.js, etc. setup on my Macbook
Add an event handler in the firebug console
Is it possible to add an event handler to an object in the console in firebug? I can add the even handler and then see it when I do .data("events") but when I try to trigger the event, it doesn't work. I do this in the console: jQuery('#shipto_country').select( function () { if (jQuery('#shipto_country') != 'US') { jQuery('#shipto_method').toggle(); jQuery('#shipto_method').val("AL"); jQuery('#shipto_state').toggle(); } else { // US is selected jQuery('#shipto_state').val(""); jQuery('#shipto_state').toggle();
Png problem in ie8 using fade with jQuery
Hi all, i have a problem with png image (with trasperency) in ie8. See screenshot in attachments to show my problem.. I use this coding: jQuery(function() { jQuery(".logo").css("opacity","0.5"); jQuery(".logo").hover(function () { // opacity 100% jQuery(this).stop().animate({ opacity: 1.0 }, "slow"); }, // mouse out function () { // opacity 50% jQuery(this).stop().animate({ opacity: 0.5
Some new selectors...intrv(), intrvR(), slct() and slctR()
Hello, everybody... I'm new on the forum, and also new with the using of JQuery. There is a long time that I want learn JQuery, but I will not have the time to do. So the last week, ones of my friends ask me if I'll know JQ and if I could help him... I answer him, no...I don't know JQ for the moment... But wait a lot I will take a look on it this night and we will see it tomorrow... We resolves the problem together the next day and seduced by possibilities of JQ I'm continuing to study... Now, I
slide show image l
I'm doing a slide show image like bing. demo: http://otohn.com/slide/welcome.html Source Bing fixed 5 images slideshow. admin can view more photos code fix it? may 10-20 ... image. Thanks !
Stop a Deferred callback queue in progress?
This dilemma may only exist because I'm an amateur and haven't thought of a better way. I love love love the new Deferred object, but I still can't use $.when() most of the time. The problem is that there are two kinds of errors: HTTP errors where an AJAX request fails, and application errors where the server-side code has a problem (like an empty form field). It requires logic like this pseudo-code: if (http_error) { handle the error } else { if (application_error) { handle the error
livequery plugin change to live()
We have recently seen that we are dragging behind in jquery land, and we currently run 1.3.2 with livequery 1.0.2 with a load of events like this to bind the validation plugin to the form: $(function() { $("#LoginForm").livequery(function() { var thisForm = $(this); thisForm.validate({ ... }); }); }); This allows us to load in forms with ajax and have the appropriate validation bind to the form that comes in. The problem however
When is jQuery 1.6 alpha or beta is expected ?
When is jQuery 1.6 alpha or beta is expected ?
possibility to override native selector in sizzle
Currently sizzle is always using querySelectorAll or *matchesSelector, if a browser supports this + the used selector and there is no way to override this behavior. My problem with this, is that there are some pseudo selectors, which are buggy in native implementations. For example the :invalid selector is buggy in safari 5 (chrome 10 works perfect) and are partial in FF4. Currently my workaround is to implement a non-standard pseudo-element -> :invalid-element. But this also means, that chrome 10
Event on showing/hiding of element
Are there any plans to provide events (like 'onshow'/'onhide') on changing visibility of elements ? There is something similar in jquery mobile but works only on divs ('pages').
Why does jQuery.Event use preventDefault as an instance test?
On a discussion elsewhere (http://tinyurl.com/3tcm6l5), I ran across the fact that jQuery.Event starts like this: jQuery.Event = function( src ) { // Allow instantiation without the 'new' keyword if ( !this.preventDefault ) { return new jQuery.Event( src ); } I'm curious as to why it's done this way rather than the more obvious jQuery.Event = function( src ) { // Allow instantiation without the 'new' keyword if (!(this instanceof jQuery.Event) ) { return new jQuery.Event(
Less than/greater than attribute filtering e.g. $("element [attribute>='value']")
Hi everybody, I have for the past couple of hours tried to find a way to do a greater than and less than comparison in jQuery, as I'm doing some frontend filtering on a XML dataset. So I have been looking at a way of doing something like this: $("element [attribute>='value']") I havent been able to find a solution so I looked into the jQuery code and found that I could solve this issue altering the jQuery core where it looks at possible attribute filtering types (approximately around line 4129-4145)
jQuery.live(), please?
I know that in most cases developers will already have instances of elements they want to bind a handler to with live() on their page when they call the method, but I've ran into cases when I needed to use .live() before I actually had any elements on the page. In this case, it would be nice to have a jQuery.live(selector, event, handler) method so that my application doesn't have to search the document for elements that satisfy the selector when I already know that there are none.
Sharing a Code Organization Framework
Hey all, I recently wrote a framework to organize jQuery on large sites. It's proven useful for both myself and very new developers. Thought I'd share. Examples here. Firefox recommended since one looks better with toSource. Cheers! Adam
valHooks discussion pros/cons
I believe there are many advantages to valHooks. Scott Gonzalez seems to have the most objection. Notes from the pull request: Val is restructured to support extension of getters/setters Additions: jQuery.fn.valHook( obj ) Override the default value getter/setter for the given elements @param{Object} obj An object containing a get and/or a set function jQuery.fn.removeValHook() Remove the valHook from data and revert back to default. checkValHooks( elem, type ) Private: checks for a special valHook
Next Page