Remove iFrame Keystrokes Gone
I really don't know what to title this question without getting wordy so if a mod has a better idea then PLEASE change the title ... What I'm Doing I'm making this online designer where people can add/edit/remove text and images. They can store all of their images in an image basket. Now when they're in the editor I open their image basket using .appendTo() to place a div wrapping and iframe. Once they make their selection and i capture all the values i need to proceed i use .remove() to totally
$(...).trigger("focus") should also trigger DOMfocusin / DOMfocusout / blur events
I believe $(...).trigger("focus") should also trigger DOMfocusin / DOMfocusout / blur events. For the DOMfocusin / DOMfocusout events I can tell that it currently doesn't happen.
Performance degradation with "toggle()"
I was using jQuery v1.2 to show/hide 1000+ items (simple paragraphs) using the 'toggle' method (simple hide/show, no animation). When pointing to a newer version of jQuery (such as 1.3 or 1.4) I start to notice the method taking much longer to execute. In Firefox 3.6.3, jQuery v1.2 would take about half a second to execute. When using v1.3 or 1.4 it takes around 4 seconds. In IE7, jQuery v1.2 would, again, take about half a second. When using v1.3 it takes about 1 second to hide, and about 5 seconds
jQuery loses event handlers when appending to multiple elements
I filed this as a bug (http://dev.jquery.com/ticket/5566) a few months ago but the forum seems like a better place to discuss this stuff now. Basically, the demo code is like this: $(function() { $('li').append($("<button/>") .text("click me") .click(function() { alert("Good job!"); }) ); });And you'd expect to get a button in each LI with a click handler. However, instead, none of the added buttons get click handlers! This was broken in 1.3.2 and is still broken in 1.4.2. Here's a live demo: http://benhollis.net/experiments/browserdemos/jquery-1.3.2-append-handlers.html
jQuery min latest available for linking to?
In the samples of the API documentation I have seen a link to the latest version of jQuery: http://code.jquery.com/jquery-latest.js Is there also a link available to the latest min version (not any fixed version, but "latest")?
Change event does not fire in IE - jquery 1.4.2
If you have a text input with a change event bound to it, the event wont fire initially if that input is given focus by a .focus() call. works in browsers other than IE code to test: <!DOCTYPE html> <html> <head> <script type='text/javascript' src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type='text/javascript'> $(function() { $('#btn').click(function() { $("#tb1").focus(); }); $("#tb1").change(function() { alert($(this).val()); });
"Object doesn't support this property or method" from jQuery 1.4.1 in IE7 ONLY
This is the offending line in the built jquery.js: // Override the abort handler, if we can (IE doesn't allow it, but that's OK) // Opera doesn't fire onreadystatechange at all on abort try { var oldAbort = xhr.abort; xhr.abort = function() { if ( xhr ) { oldAbort.call( xhr ); // <-- * DIES HERE * } onreadystatechange( "abort" ); }; } catch(e) { } The error only happens in IE7. IE8 and FF 3/3.5/3.6 are all unaffected. If I comment out just this single
ajax / jsonp - what's the request string?
Hi all, I'm performing an asynchronous HTTP request through jQuery.ajax(). dataType: is "jsonp", and data: contains my request parameters. The call is working as expected. Is there any way to access the request string in use by .ajax(), e.g. http://example.com?a=1&b=2&c=3 From the forum I understand it would be possible to use xhr.url in the local beforeSend and global ajaxSend event - but these events don't seem to fire with jsonp. So how could I read the actual request string in use for a jsonp
Callback not called after image load in some cases.
Many people experienced these problems. In some cases (e.g. if the image is cached) the load event isn't called. See these threads: http://www.witheringtree.com/index.php/2009/05/image-load-event-binding-with-ie-using-jquery/ http://stackoverflow.com/questions/1700864/making-images-fade-in-on-image-load-using-jquery http://forum.jquery.com/topic/ajaxcomplete-after-load-problem-with-cache http://www.sitepoint.com/forums/showthread.php?t=667209 Could someone figure out how to fix this?
.animate does not play well with css display: box; (and inline-block as well)
The .animate code doesn't play well with css' new box display type. When animating a width or height jQuery sets the display to block breaking the content in the box, despite the fact that box model content works perfectly fine with animation. Line 5738 of jQuery-1.4.2.js has a statement: this.elem.style.display = "block"; .animate can be made to play well with box display with a condition like this to test the display type. this.elem.style.display = /^(-(moz|webkit)-)?box$/.test(this.elem.style.display)
Typo in api.xml
Hi, by accident I found a typo in the current api.xml @ line 10705 (in red here): <blckquote>Unlike in the rest of the tree traversal methods, the selector expression is required in a call to <code>.find()</code>. If we need to retrieve all of the descendant elements, we can pass in the universal selector <code>'*'</code> to accomplish this.</blckquote>
Typo in wrap() function?
I just got stuck on an exception in IE8 which is caused on the fact that I wanted to wrap some .contents() result with "<div class='anything'></div>". Trying to debug the problem I noticed the following code in line: 3992: wrapMap._default = [ 1, "div<div>", "</div>" ]; Is the leading "div" a typo? I would have expected this to read: wrapMap._default = [ 1, "<div>", "</div>" ];
$("button[value='submit']) selector has different behaviour in IE8 and other browsers
For a tag button like this, that has an attribute "value" assigned and also contains some string (different from the "value" attribute): <button type="submit" value="submit">Send</button>selector $("button[value='submit']")returns an empty set in IE8, while in other browsers (FF, Opera, Safari, Chrome), it gets me the right button. Although selecting the button using $("button[value='Send']") works in IE8, while returns an empty set in other browsers. I couldn't find any information in the CSS specification
height() returns incorrect value of inline elements in Safari
I just discovered a problem in Safari 4.0.5 (Windows 7 x64) using $("#myID").height() to get the height of an inline-styled element (a div in this case) which contains other elements (several paragraphs in this case). A quick research has not revealed any posts about it therefore I’m posting it here. All major browsers return the right he height, except Safari. This problem doesn't occur if the div contains no (block-level?) elements or if the div isn't styled as an inline-element. From my point
"$.event.special.live.add" does not pass data argument to "$.event.add"
I am attempting to support "live" events in a custom special event, and the data object passed in the "bind" method gets passed into my special event "setup" function. This allows accepting that argument as options. This does not work with the "live" method. The "data" property is correctly set in the "live" handler "event" object, but not passed into my special event "setup" function. It is a very small change indeed. On line 2029 of jQuery 1.4.2,in the "jQuery.event.special.live.add" function,
IE8 dragging execution speedup
Hi, Sorry for my english Scenario: a scroll gallery: a draggable div move another div <div id="draggableDiv">.... <div id="spot" style="overflow:hidden"> <div id="slaveDiv"> <img id=1><img id=2>.... </div> </div> var dragOption = new Object(); dragOption.axis = 'x'; dragOption.drag=dragCallBack; ... //moving slaveDiv by draggableDiv drag event function dragCallBack(event, ui){ slaveDiv.css('left', 0 - draggableDiv.position().left); // draggableDiv.position();// USE
closest should return the deepest match for each selector
For performance reasons, and for what I considered expected results, closest should return the first match per selector. This is causing problems with event delegation with nested DOM structures. For example: Consider a nested menu like: <ul><li> Option 1 <ul><li>Option 2</li></ul> </li> And the following code $('li').live('click', function(){ $(this).addClass('clicked') }) If you click on the deep li, the event handler function will be called on both LI's. This makes using event delegation
`make lint` fails in HEAD (d6f03aa0df4f734f6f09bf82effa5b7fcd8487fc)
I just tried building jQuery with 'make' (make all) but this fails because 'make lint' fails with the following errors: % make lint Grabbing external dependencies... Building selector code from Sizzle Building ./dist/jquery.js Checking jQuery against JSLint... }; var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, Problem at line 4007 character 2: Unnecessary semicolon. undefined Problem at line 6308 character 25: Too many errors. (99% scanned). js: uncaught JavaScript runtime exception: TypeError:
We found a conflict when using the jQuery.min.js package and other tools.
When those other tools do a page reload during the page load they conflict with jquery.min.js. The exact place is line 943 // Figure out if the W3C box model works as expected // document.body must exist before we can do this jQuery(function() { var div = document.createElement("div"); div.style.width = div.style.paddingLeft = "1px"; document.body.appendChild( div ); jQuery.boxModel = jQuery.support.boxModel =
How about a Compare() function ?
I have looked alot but I haven't found anything to compare two or more objects if they are the same or not...then return bool (true,false). <div>ABC</div> <div>ABC</div> <div>ABC</div> <div>abc</div> var d1 = '';// reference to first div var d2 = '';//reference to second div var d3 = '';// reference to third div var d4 = '';//reference to fourth div jQuery.compare(d1,d2);// return true jQuery.compare(d3,d4);// return false the compare function should compare an object or an html element if they are
Using .animate() with .data() -> stack overflow
Hi, I think i found a problem in jQuery. If you store the options and properties for el.animate() in el.data(), it will end up in an stack overflow. jQuery version: 1.4.2.min Firefox version: 3.6 The way i used it: I stored the information in data() on pageload. When calling the animate function, i recieve them from data(), and pass them to animate(). This works, if you only call the animate function once. (e.g. to hide a div) If you call it again in order to show the div, you will have firefox posting
Google Chrome Ajax issue with empty post bodies
When issuing a POST/PUT/DELETE ajax() request without a `data` parameter, Google Chrome sends "undefined" as the request body, breaking backends which expect well-formed form-urlencoded data (in this case, Ruby on Rails). We've been bitten by this today. Patch attached to a 7 months old ticket dev.jquery.com/ticket/5123 Just wanted to give a heads-up, since it's a trivial fix. The patch also enables the user to send data in bodies of requests other than POST and PUT (full HTTP methods list: http://annevankesteren.nl/2007/10/http-methods).
newline between DOCTYPE and root element when using $(xxx).html() causes unexpected behaviour
The effect is that a valid xhtml fragment is not easily accessible via the jquery api when it has whitespace between the DOCTYPE and the root element in JQuery 1.4.2. Posted as bug 6380 Browser version lildiv loldiv EXPECTED all pass pass Windows Chrome 4.1 pass fail Windows IE 8 fail fail Windows IE 7 fail fail Windows Firefox 3.6.2 pass fail MacOS X Firefox 3.5.8 pass fail MacOS X Safari 4.05 pass fail Three files are used to demonstrate this problem (see attachment jqproblem.zip ). The core
width, innerWidth and tables
http://www.w3.org/TR/CSS21/tables.html#height-layout There are some adjustments to make when getting the innerWidth of tables. Tables use something closer to the old IE box model (where clientWidth includes the padding) which makes width and innerWidth incorrect. I propose fixing this by checking the display property. If it is table-ish, adjust accordingly. I can make this patch (along with everything else) when I finally get some time ....
Problem with newline between DOCTYPE and root element when using .html()
Three files are used to show this problem (see attachment jqproblem.zip ). The core code is as follows, and jquery (1.4.2) is not behaving as expected for the loldiv.html text, which is a legal xhtml fragment. var urli="lildiv.html"; //has no linebreak between DOCTYPE and document element (no fail) var urlo="loldiv.html"; //has linebreak between DOCTYPE and document element (fails) $.get(urli,function(data){ loadPanel(data,"div.i"); }) $.get(urlo,function(data){ loadPanel(data,"div.o"); })
:hidden/:visible broken in IE8
The :hidden selector is incorrect for a <button> with style display:none, after some text, in Internet Explorer (tested in IE8). There are possibly other situations in which it is broken, but that's what my testcase reduced to. It's caused by both offsetWidth and offsetHeight being non-zero, but, despite the specivity of the bug, I'd say it's a problem that should be solved in jQuery. There already seems to be a built-in workaround for <tr> elements. There's a testcase attached (it needs jQuery copying
Commit logs and formating
Currently mosy commit messages in both core and ui git are oneline messages, often rather long. It is common for people to have following in their .gitconfig: [core] pager = "less -+$LESS -RS" The -S flags implies that no automatic wrapping should be done, and thus in our case, most of the commit log is hidden. If you are using vim/gvim for adding/editing/modifying the commit messages, you'll notice it actually marks the portion that should be an header:
How to stop the timer?
Hello, I try to stop my timer, but nothing happend. My Javascript-Code show on the follow: function Ticker() { var xhttp; function create() { //init xmlhttprequest; } function send() { //send-init } function xmlparse() { //parse xml-file; callbackTimer(timeOut) } create(); send(); } function callbackTimer(timeOut) { setTimeOut("Ticker", timeOut); } How programm a stop-function to abort the reload-function of the php-file. Thanks.
Explanation of event namespacing logic?
I was wondering what would happen if I bound an event handler with multiple ("nested") namespaces. It seems to work: jQuery(document).bind('click.ui.foo', function(){}); ... And it follows that this will remove that event handler: jQuery(document).unbind('click'); So will this: jQuery(document).unbind('click.ui'); And this: jQuery(document).unbind('click.ui.foo'); And, to my surprise and confusion, so does this (proof: http://jsbin.com/irufo3): jQuery(document).unbind('click.foo.ui');
JQuery alternative SELECTORS ....
I am sure that everyone has come across this problem and wishes they had an easier option ... var selector = $('#selector'); $(selector+' .class').foo(); or var selector = $('#selector'); $(selector+' li').foo(); I was wondering if the above could be implemented and i am sure that everyone would find it helpful, especially when dealling with UI's. I think it would defenetly speed up the time we spend developing with jquery.
.serializeArray() as JSON Map
Hello again! Well, I propose this: Currently, if you use .serializeArray() will get anything as: [{name: "test", value: "test"}, {name: "test2", value: "test2"}] But if you need pass this as POST in AJAX (that need a MAP object), you need converts: {test: "test", test2: "test2"} I propose .serializeArray(asMap = true) to generate this. Bye.
Button creation javascript error in IE7
Creating a button in IE7 fails when I try to set the type to "button". See below examples: $("body").append( $("<button/>", {"id": "save", "type": "button"}).html( "Save" ) ); $("body").append( $("<button/>", {"id": "save"}).html( "Save" ) ); $("#save").attr( "type", "submit" );IE reports that the "Object doesn't support this action" for #1 and "Exception thrown and not caught" for #2.
document.ready - thickbox - Chrome
When using document.ready inside a page that was loaded into a thickbox via AJAX, document.ready will only be fired it if is placed at the bottom of the document body. It will not fire if the document.ready call is set up in the head section. I really dont want to move all my script code to the bottom of the page, but it looks like I have to if I want to support Chrome. Any suggestions?
Recursive .children(a, b) instead of .children(a).children(b)
I would like to suggest extending the functionality of a .children method (and other traversing methods where applicable) to accept variable length parameters set. Currently I use my own extension method which does the job: jQuery.fn.extend( { childrenCascade: function() { var result = this; for (var i = 0; i < arguments.length; i++) { result = result.children(arguments[i]); } return result; } } It would be nice to have such an option
Issue with event bubbling and jQuery 1.3 live.
I am having a issue with the live event functionality in jQuery 1.3. Basically, I have a list with various options in this form: <ul> <li><a href="something">Bla</a></li> . . . . </ul> I want to do something when the user clicks on the list item (it has a rather wide width), and I want to do something else when the user clicks on the link inside the list item. Since the list is going to be a dynamic list I need to use live events. However, when I use live events and click on the <a> tag, the event
dialog with datepicker
Hi, I have a dialog in which i need a few datepickers and also date validation. How do i do this? I've tried but the datepicker seems to end up behind the dialog. Thanks! /Kris
Issues with cloning hover event
I'm running into an issue with cloning a jQuery object with a hover event. For each clone of an item, the hover events are stacked rather than just duplicated. <html <head> <title>jQuery Clone Hover Issue</title> <script src='jquery.js' type='text/javascript'></script> <script type='text/javascript'> $(document).ready(function(){ var box1 = $('div'); box1 .click(function(){ $(this).append('Click'); }) .hover(function(){
Changing behavior of events to use something else than this
If you use events the this reference is overwritten with the triggering DOM object. In classes this is not very useful because a direct called function looses their this reference. My suggestion is to give the user a method to change the behavior of events in the way that the user can set a new name where the DOM object reference is saved. For Example: var A = { var1 : 1, f1 : function() { alert(this.var1) //will fail when event calling f1 directly alert(A.var1) //will always work } }; $(window).ready(A.f1);
jQuery dialog with validation on dates
Hi, i have created a jQuery dialog with a few textboxes in which the user will enter dates. I need to use jQuery datepickers and also validate the dates with different criterias. How do i do this? Thanks! /Kris
after aborting an ajax call, success event is still being fired?
after calling .abort(), in 1.3.2, success event will not be fired if it hasn't been already. In 1.4+, it seems success event is always always fired after the abort, and return value is always null. Can someone confirm this? I think, the correct behavior is to not fire success event since the call has been canceled. It would be helpful if someone can give a complete picture as how the ajax events (beforeSend, start, complete, error, success, etc.), both local and global, are handled when abort() is
Next Page