Suggestion.. return an error code from trigger(), submit(),etc functions if the following condition exists..
<!-- Suggestion.. return an error code from trigger(), submit() etc if the following condition exists.. If you have an input element in a form with the name or id of 'submit', it will cause the $form.submit()/trigger("submit") call to fail. Reason, the input element with name/id 'submit' is put into the form DOM element as { submit: <elements html> } Line of code failing in jQuery: line 1889: jquery-1.4.2 (uncompressed) target[ type ](); target is the form
Memory retention issue with ajax and timeouts.
Not sure if it is required for me to notify you, but I've identified an issue and created a ticket (#6583). I think I may have found a memory retention problem to do with ajax and timeouts. A test case has been attached to the ticket.
$.extend deep copy and Date
Hi, I was having some issues with $.extend deep copy. basically i have something like this.(the actual object was nested so i was using deep copy). var oldVal = { time: new Date('Fri Jun 20 16:32:09 UTC+0530 2008') }; var newVal = { time: new Date('Fri Jun 20 16:32:40 UTC+0530 2007') }; var currentVal = $.extend(true, {}, oldVal, newVal); // deep copy the object after this i expect the currentVal.time to be a date object, however i am getting it as an object (not a date). I have
jQuery object assumed to be in global namespace causes troubles
Recent change to core.js wraps itself in a closure, causes references to the jQuery object in other parts of source code no longer to be pointing to the jQuery variable but to the one in global namespace. This breaks jQuery itself when the window variable is set to an iframe window, or having a variable named jQuery declared somewhere outside jQuery code (my case).
Unique identifier for all elements on which jquery is used
Is there a functionality for a unique identifier for all elements on which jquery is called? Currently I use this.selector. I think this is wrong. What about jQuery.uuid ? Regards
Why the line breaks in 1.4.2?
I notice the minified version of 1.4.2 uses line breaks around column 500-510, where 1.3.2 did not; any reason? http://code.jquery.com/jquery-1.4.2.min.js vs. http://code.jquery.com/jquery-1.3.2.min.js Only means .1kb in file size, but sure makes scrolling through my global JS easier when jQuery is only one line... I thought I had read something some time back about "ideal line lengths" or something, but can't seem to find any such references on Google now... Thanks, Atg
image load event in 1.4.2 and beyond
I was wondering if there are any plans to change or improve the way the load event works when handling images I know the load event doesn't always fire when pulling images from the browser cache, and while there are ways around this (like checking for the complete property, src or natural width), there seems to be some browser inconsistencies that complicate the issue, and nothing that I've found that is just clean and simple I found some other discussion about image loads from a while back http://forum.jquery.com/topic/image-load-event-some-progress
.delay() bugfix and extension
Hello, I tried to fix the .delay() problems, listed here: http://dev.jquery.com/ticket/6576 http://dev.jquery.com/ticket/6150 http://dev.jquery.com/ticket/6255 You can find an update for queue.js at the first bug description. It needs more testing, but works on the added tests and also is backwards compatible. Grab updated queue.js and test.html here: http://dev.jquery.com/ticket/6576 There are currently two things that need improvement: 1. I tried to generate a unique id for all timeouts for an
proxy and unbind don't play well with each other
Hi All, I have attached a sample page that demonstrates a jQuery event binding problem that we are having with our code (note that it needs John Resig's patch to fix event binding on plain objects which I've included in the zip: http://github.com/jquery/jquery/commit/7f5179b65431b77e89fa32623a5000e3630c191c ). We know why the code breaks, but think that it is an oversight/bug in how unbind removes handlers from the listeners list. Basically when proxy generates guids for the proxy functions, it reuses
.live() method for "change" don't work in IE 8
It seems that if we put the .live("click",function) before the .live("change",function) , then .live("change",function) doesn't works in IE8 This doesn´t works in IE8: http://jsfiddle.net/5cwC9/ But this works in IE8: http://jsfiddle.net/KgNaQ/
jquery.support --> requesting different "feature support" items
i just wanted to create a topic for any "feature support" items that could be used for the jquery.support.* There's currently a bunch 1 on this page: http://api.jquery.com/jQuery.support/ I'll list mine as well as the others I see on that page. 1) CSS3 features 2) (Mine) For "IntrAnet" programming, it's often useful to be able to link to the common file share. \\server\share\folder\item.txt. Now, IE would let you enter this in any format, while firefox (if feature is turned on) wants you to enter
accessing stored documentFragments from jQuery's .data method in IE throwing js error
Hi, This is probably a super edge case situation (and pretty tough to explain) so please bear with me. :D Basically I'm trying to load up a cached documentFragment (stored in jQuery's data obj) that contains DOM elements. In IE, after the second time they are appended to a div element, I am getting a javascript error in jquery-1.4.2.js: Line 4519 Error: 'events' is null or not an object So I got rid of the error by changing that line from: if ( data.events ) { to: if ( typeof data != 'undefined'
How to use multiple versions of jQuery
Hi, I've written an article and small bit of support code to aid in the use of multiple versions of jQuery (and possibly other) JS libraries in a page: Docs: https://www.adaptavist.com/display/~mgibson/Using+multiple+versions+of +javascript+libraries Code: http://test3.internal.adaptavist.net/~mgibson/versions/ I'd be interested in feedback on this: * Can you foresee any problems with this technique? * Would it work for any other of the major JS libraries? * Should I put it somewhere on jquery.com?
Problems with .live() method in Google Chrome
I'm using the jstree plugin (found at http://jstree.com) for a web tree I have to display to the users. I also use the contextmenu plugin for jstree to display some node options. I started having problems with the context menu in Chrome whenever the user actually clicked an option (the context menu is displayed correctly): the browser just didn't process the option selection. Checking the source code for the contextmenu plugin, I found out they used the .live() method to attach a click event in
IE and Firefox, jQuery.isEmptyObject(String) behaves differently.
[IE 8.0.7600] jQuery.isEmptyObject("abc") // true [Firefox 3.6.3] jQuery.isEmptyObject("abc") // false Because if the string is declared such as the following var str = "abc"; In the case of Firefox, str variable has three properties. str[0] // 'a' str[1] // 'b' str[2] // 'c' In the case of IE, str variable has not property.
preventing silent failures due to swallowed exceptions
While jQuery's tendency to (deliberately) swallow exceptions can be useful, it can lead to some annoyances. In particular, this often makes debugging unnecessarily painful (especially in callbacks). In order to mitigate this issue, it might be useful for jQuery to fire a custom event when an exception is being trapped. That would allow developers to decide how they want to handle exceptions without compromising current behavior. Does this seem reasonable? (It appears this issue has not been brought
Fade Callback on Elements
In the following example, both fade events start at the same time. Seems to do with the first fade event including the 2nd. Example (click 'go'): go foo bar Code: <script type="text/javascript"> function foobar(){ $('.foo').fadeOut(800, function(){ $('#bar').fadeIn(800); }); } $(function(){ $('#bar').hide(); $('#go').bind('click',function(){foobar();}); }); </script> <div id="go">go</div> <div class="foo">foo</div> <div id="bar" class="foo">bar</div>
How do I get iE6 to fire jquery change event without using jquery?
I need to fire change events in iE6 without JQuery, I use something like this code to trigger the event: document.getElementById("mySelect").fireEvent("onchange");Since JQuery 1.4, this doesn't trigger a jquery change event, ie .bind("change", myFn) isn't called when this above code fires. I know "change" had a large overhaul and has done some normalizing of this event. Do I need to add or edit the event somehow to make the fireEvent trigger jquery bound events? Fire a different named event?
Repeat calls with jsonpCallback break
If you do a jsonp request followed by another jsonp request, with jsonpCallback set, the callback function is deleted before the second request completes. Example: $.ajax({ url: "1.json", success: function(){ $.ajax({url: "2.json", jsonpCallback: "C", dataType: "jsonp", success: function(){} }) }, jsonpCallback: "C", dataType: "jsonp" });An easy solution would be to have the garbage collection happen before success is called.
Id selector
jQuery does not work with elemets, that has $ sign in their id. Example: if I have <div id="ctl00$mydiv"></div>, then $("#ctl00$mydiv").length will be zero. I suggest to append $ sign in line 38: where quickExpr = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/ change it to quickExpr = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w$-]+)$/
trigger with many data params
I've implemented drag/drop to work as special events. I'd really like to have the drop work like: $(el).delegate(".drop","drop",function(ev, drop, drag){ if(drag.hasClass('nope'){ drop.cancel(); } }) But as trigger can only take 1 data argument, I can't pass the drag to the event handler unless I rig it into the event or drop. I don't want to do this b/c they are are independent. Is there a reason for this limitation? I know arguments makes things relatively slow, but it would be inconsequential
.live() support for form submit?
I just came across the need to have .live() support form submit, so naturally I think that everyone else needs it too :) I see that this was discussed back in September a bit, but I haven't heard anything about this lately. google groups thread Is there a chance that support for submit might be included for .live() sometime in the future? Thanks -Geoffrey
Change doesn't fire in IE8 if you remove the element on focus of another element
If I am calling .remove() on the currently focused element when another element is focused on, a change event is never triggered by the live code in IE. The problem is Focusout is called after the element is already removed, preventing live from calling testChange to trigger the change. To fix this, jQuery should use the beforedeactivate event like: beforedeactivate: testChange,This might be difficult to make a test case that you don't have to do manually, but I will try.
Set data on an element while it is just HTML
I think it would be very useful to allow setting of data on an element without a reference to the actual element. This is for performance reasons. The following is a longer explanation. I use data a lot. I typically use it in the following (and I believe, extremely common) pattern: Get data from a service Convert that data to html Insert HTML into the page Iterate through html to add service data on the elements A good example of this would be a tree. When someone expands the tree, I need to
My first conditional
I am looking to do something like this... if ( $(".class_big") exists ){ $(".content").css("margin-top", "10px"); } else { $(".content").css("margin-top", "20px");} If this class exists then do something to another class else do something else to the class.
$('.selector').css('max-width' / 'max-height') == '-1px' (Opera)
I'm testing Opera 10.52 and it seems max-width/height css properties have "-1px" as their initial values. Seems to be by design. Perhaps jQuery should implement a workaround?
json with newlines in strings should be valid
The 3 character json string: " " (which is U+0022 U+000A U+0022) is accepted by most languages, and it appears that the spec accepts Any Unicode character except " or \ Is there a reason we don't allow that? And the same question for the 3 character string U+0022 U+000D U+0022 and the four character string U+0022 U+000A U+000D U+0022 I made a silly simple page for testing: http://paulisageek.com/json_validator/
live() method for 'change' event broken in Jquery 1.4.2 for IE (worked in 1.4.1)
Hi! After updating the core to 1.4.2 today I noticed that the .live('change') stopped firing in Internet Explorer. This was not the case in Jquery 1.4.1, as it was fixed in that version according to this: http://groups.google.com/group/jquery-dev/browse_thread/thread/e74de6015020d160 . I can not see any errors thrown that would stop JS from executing as the rest of the application is working, but as I said, change does not fire. I thought this would be a good thing to take a look at before 1.4.2
Parse error with WebKit mobile browsers and jQuery 1.4.2
Changes between jQuery 1.3.2 and 1.4.2 cause a parse error on WebKit mobile browsers (at least on Nokia E71 and iPhone). In jQuery 1.3.2 line 3189 doesn't cause parse error: div.attachEvent("onclick", function(){ In jQuery 1.4.2 this is line 920 and causes parse error: div.attachEvent("onclick", function click() { Additionally jQuery 1.3.2 line 3193 has changed from: div.detachEvent("onclick", arguments.callee); to this in jQuery 1.4.2 line 924: div.detachEvent("onclick",
Internet Explorer 6,7 swallow change events triggered with standard javascript:
I have found a bug in 1.4+, the problem is described here: http://forum.jquery.com/topic/how-do-i-get-ie6-to-fire-jquery-change-event-without-using-jquery I have since forked, written a test, then patched the code (trivial) and submitted a bug report: http://dev.jquery.com/ticket/6420 Here is my github commit: http://github.com/thetoolman/jquery/commit/a228013a706999df8dd3f70508c4f1b4298b2c21 I am surprised that I haven't seen any movement on my ticket in a week. Have I forgotten to
jQuery :first and tbody does not play well
I've created a bug report already for this, but apparently I wasn't getting through to him. The problem: According to W3C specs, a <tfoot> tag must come BEFORE any <tbody> tags in a table. However, when rendered on screen, the contents of the <tfoot> tag are placed AFTER the <tbody> tags. Of course the <tfoot> can be absolutely positioned and moved around using CSS, but really, who does that? I'd say the majority don't. Now lets say I have an input box inside of <tfoot> and an input box inside
jquery-tmpl
This is a follow up to John's http://forum.jquery.com/topic/templating-syntax I'm going to break it up into small post because I'm having issues with the forum WYSIWYG on MAC FF if I accidently hit shift+delete and have lost several posts, and I'm a lot shy of wasting time trying to write on it now.
Using Array.isArray for jQuery.isArray when available
ECMAScript 5 defines Array.isArray and is available in Firefox and WebKit (only ones I checked). I think jQuery should use it, if available, instead of checking the object's toString being "[object Array]". For one, it will solve a problem I have with Webkit and Qt. It allows one to expose Qt arrays in javascript, but those are of the RuntimeArray class. This causes the jQuery isArray function to fail identifying them as arrays, while the native Array isArray succeeds.
jQuery("does not exist ").data() throws exception
the following code from jQuery(1.4.2).fn.extend( { data : function {.........} } ): if ( typeof key === "undefined" && this.length ) { ..... } else if ( typeof key === "object" ) { ...... } does not handle the situation when: key is undefined,and this.length===0, next line of code: var parts = key.split("."); cause the exception because key is undefined. I think jQuery("does not exist ").data() should return undefined , instead of throwing an exception.
about jQuery.parseJSON
when I see the codes below: return window.JSON && window.JSON.parse ? window.JSON.parse( data ) : (new Function("return " + data))(); I think the the (new Function("return " + data))(); is slower than use eval directly, it may be improved this way: ( eval( "["+data+"]" ) ) [0]
IE8 bug (?) - slidetoggle -> disappearing margins (example included)
Hi, I'm having the weirdest issue with IE8 (it works perfectly in all other major browsers - even IE6). URL to example: http://www.tvh.com/ie8/ie8.html What happens on this page? on "div.box span.slider" (upper right of each box) there is a click eventhandler which slidetoggles ".box-content", and changes the status image inside "span.slider". What is going wrong in IE8? in the IE8 viewport, when randomly slidetoggling a bit, you'll notice that the bottom-margin of the clicked "div.box" kinda disappears.
fix for bad implement of iframe event in IE?
In IE, events are attached to iframe DOM element In FF, events are attached to iframe.contentWindow DOM element I just curious if jQuery can normalize the bad implement in IE?
Will it be better if jQuery accept string for radio/checkbox selection?
If I use jQuery to select radio/checkbox, it accepts array only, I think it may be good if jQuery can accept string for single selection. 1416c1416,1418 < if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) { --- > if ( rradiocheck.test( this.type ) ) { > if(!jQuery.isArray(val)) > val=jQuery.makeArray(val);
about jQuery.makeArray
makeArray: function( array, results ) { var ret = results || []; if ( array != null ) { // The window, strings (and functions) also have 'length' // The extra typeof function check is to prevent crashes // in Safari 2 (See: #3039) if ( array.length == null || typeof array === "string" || jQuery.isFunction(array) || (typeof array !== "function" && array.setInterval) ) { push.call( ret, array ); } else { jQuery.merge( ret, array ); } } return ret; }, when the argument arr is actually an array, it
jQuery.tpl
Hi all! Impressed by micro-template engine written by John Resig, I've been created this templates variant: Few examples: // Simple {% for (var i=0;i<100;i++) { %} <div id="{%= i %}"></div> {% } %} // With shorthands {%@ func(abc) { %} {%= abc %} {% } %} {% func("hello world!"); %} // Other features {%@ button(value) { %} {%= $('<button>'+value+'</button>').click(function() { alert(value); }) %} {% } %} {% button("text"); %} Also this engine can have named templates and can easily call it from other
Next Page