Patching jQuery in order to avoid IE6 & 7 memory leaks ?
Hi all, <exposing_context not_forced_to_read="true"> In a recent project, I coded a table listing pager. This listing behaves a little like ingrid http://reconstrukt.com/ingrid/example1.html In my page, when "next page" button is clicked, an ajax call fetch the html rows of next page and I just do something like $("#table tbody").html(html_rows_fetched_from_ajax_call); When the [edit] button of a row is pushed, I toggle visibility of the table listing with another div called "form_container". I use
Trigger Native Events (except for clicks on links)
<div>On line 2043 of 1.2.3 we exclude native link clicks... Why is this? On my test page at: </div> <div><a href="http://jdsharp.us/sandbox/jQuery/trigger.html">http://jdsharp.us/sandbox/jQuery/trigger.html</a></div> <div> </div> <div>I get different behaviors for FF and IE with FF responding and triggering the native click event and IE( 6 & 7) supressing them.</div> <div> </div> <div><strong>Line 2043:</strong></div> <div>// Trigger the native events (except for clicks on links) if ( fn && donative
Hidden Property
Hello. Sir. . I want to know that how can i set the value of Property we use like (':visible') and (':hidden'). Can we set the value of div as "hidden" and "visible"
Can we expect more extensive AIR support coming in jQuery?
Looks like Dojo is directly supporting some of the AIR APIs. Anything like that being thought of for jQuery? Or would that likely be more in the realm of an add-on module than part of the core? http://ajaxian.com/archives/dojo-on-air-shows-detail-on-air-itself
jQuery 1.2.3 on github
If you are interested. You can use github to get jquery 1.2.3. I will be adding plugins and such over time and as I use them. Here is the clone link: git://github.com/davemerwin/jquery.git Thanks. Dave
Clean jQuery.cache ?
Hey, I see that jQuery 1.2.3 is doing a global unbind on window.unload. Wouldn't it be good to also clean jQuery.cache completely ? or at least a jQuery.cache = { }; By the way, just saw the new globalEval.. it rocks :) Cheers Ariel Flesler
Bug with jQuery attr
The jQuery attribute function returns undefined if the value of the attribute is 0. The HTML code below returns undefined if you select "Foo", but 1 if you select "Bar" <select id="foo" onChange="alert($('#foo').attr('selectedIndex'))"> <option value="Foo">Foo</option> <option value="Bar" selected>Bar</option> </select> This is because of the following line (in jQuery 1.2.3 line # 178) return this.length && jQuery[ type || "attr" ]( this[0], name ) || undefined; The problem here is that the return
OT: Use CommitMonitor to notify you of changes to SVN repositories...
I just came across CommitMonitor--which is a tool for monitoring SVN repositories. It's basically like an RSS reader for SVN repositories. I'm sure the jQuery Dev Team already has tools in place, but for anyone who just wants to proactively keep up with the changes being made to the SVN, this tool could provide valuable. http://tools.tortoisesvn.net/CommitMonitor I also like the fact that there's no need for an installer, just unzip and run (if you don't like it just delete the executable.) Hopefully
Some weird problem changing elements properties and ajax
Hi, I'm using the jQuery form plugin and SimpleModal plugin and I'm having a little problem that I don't understand why it's happening. As my understanding in the whole thing, this shouldn't be happening and I can't understand why. The thing is, I show a blue popup while the page is loading, it shows on document ready and it hides on window load. Then, you submit a form and the form is submitted by ajax so there is a request and response. On the request I show a blue popup saying the form is submitted
Bug in $.fn.stop() - no cleanup occurs
It looks like there's an issue with the stop() method. It does not perform the cleanup procedure that the step() method handles. This means calling the stop() method on any elements animated with the animate() function are left in an altered state. The code in the step() if( done ) block should be migrated to an some kind of fx.cleanup() method that can be called from the stop() method to make sure the element is truly returned to it's original context. I actually noticed this problem while helping
A simple "global" registry/storage plugin
Hi guys, Wrote a simple "global" registry/storage plugin (kind of like jQuery.data but global) the other day that is being used in a big JS/jQuery project I'm involved in. It has unlimited name space support and you can even lock variables from being overwritten :) Take a look at: <a href="http://pastie.caboo.se/156664">http://pastie.caboo.se/156664</a> Might be usefull for someone. /Christian
Differences between 2 pieces of code (jQuery.extend)
Hi there again, following my last topic, I have another doubt that is more or less the same... Besides syntax, is there a difference between this: (function($){ $.extend({ A: { abc: function() { alert("ABC"); } } }); })(jQuery); And this: (function($){ $.A = { abc: function() { alert("ABC"); } } })(jQuery); ?
Differences between 2 pieces of code (anonymous functions)
Hi, I've been reading the jQuery documentation, the authoring plugins section and I'm confused about the whole hidden functions thing. Question #1: (function($) { // CODE })(jQuery); This was the thing that got me most confused when reading the documentation. Can someone explain me: a) What it does b) What is it for c) The best scenarios where would I need to use something like this Please explain me these like if I was really dumb :P Question #2: How is this: (function($) { $.something = function()
Problem with div tags
I am having a problem getting my click functions to work properly. Here is a look at my html code. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/ TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <script type="text/javascript" src="lib/jquery/jquery.js"></script> <script src="lab4.js"></script> </head> <body> this is <a href="http://jqury.com">fake
Small optimization to step() method...
Since I've been looking at the animation code a lot today, I noticed a quick optimization that save a few processing cycles and reduce the code. The current code has the following check to see if an animation is done: var done = true; for ( var i in this.options.curAnim ) if ( this.options.curAnim[i] !== true ) done = false; However, if "done == false" the next line that's actually executed is return false. You can just remove the done variable all together and just return false after that check.
jquery Forms plugin
Hi All, Inactivity in the forms mailing list unless I'm missing something.. so anyway. Interesting behaviour and comment on the Forms plugin ajaxSubmit. I've been trying to get ajaxForm to work with cbparser - a php based bbcode to html conversion utility. It's great and seems to do the trick. Only problem was that newlines weren't working with jQuery/ AJAX. Solution - ajaxSubmit posts newlines as %0A, whilst cbparser expects \r \n. Standard posting (without ajax) also sends \r\n.. weird.. anyway.
should index() except $() ?
Here is a small patch that will allow .index() to except DOM elements or a jquery object. If it is a jquery return, it will use the first element. Not sure if this is useful for anyone else.<br clear="all"> -- <a href="http://morglog.alleycatracing.com">http://morglog.alleycatracing.com</a> Lets make up more accronyms! <a href="http://www.alleycatracing.com">http://www.alleycatracing.com</a> LTABOTIIOFR! ROFL! ROFL! ROFL! Upcoming alley cats, reviews, touring logs, and a general congregation of bike
bug report: $.getJSON() JSONP callback never gets called
I've posted a new ticket on trac, though i might post a notice here too. http://dev.jquery.com/ticket/2363 i did not quite do well on labeling and categorizing the ticket, so someone with the authority might want to fix it. > "Component" and "Keyword" labels
unique identifiers after clone
This method makes the 'id' and 'name' attributes unique, which is very useful after cloning. It updates 'for' attributes in 'label' tags as well. The 'for' and 'id' will continue to match and, if 'id' and 'name' are the same (common in form field elements and anchor tags). jQuery.fn.extend({ // Correct uniqueness for all id attributes and assoc labels. // Correct uniqueness for all name attributes. makeIdentifiersUnique: function(makeUnique) // makeUnique: (optional) returns unique
How does chaining work? (In JavaScript.)
When I chain jQuery functions, say... $("#myId").css("background-color","red").show(); What exactly is happening in JavaScript? $ is just an identifier, so the first pair of parens says I'm calling a function with a string as a parameter. But isn't the rest of the chain going to go looking for something deep inside $? What am I missing? Does it all go in somehow as a parameter? Why does it work? What part of the source can I look at to see this in action? Suppose I wanted to make some kind of Forth-like
hasClass Performance Enhancement
<div>With the addition of hasClass() in 1.2 I noticed that this is simply an alias for .is(). In the project I'm working on there's a need to rely heavily on .is('.class'). I've seen a noticeable improvement in speed by changing .is('.class') to .hasClass('class') and duplicating the behavior of classFilter. Thoughts on this change?</div> <div> </div> <div>$.fn.hasClass = function(selector) { return this.is( "." + selector );</div> <div>};</div> <div> </div> <div>$.fn.hasClass = function(selector)
Problem with jQuery 1.2.2/FF2/many click handlers
Hi, I have a form with 2954 radio buttons in a table with 211 rows. I use jQuery to attach a click handler to each radio. This works fine with jQuery 1.2.1 and Firefox 2.0.0.12 on Mac OSX 10.4 but with jQuery 1.2.2 and 1.2.3 there is a problem: When the form is opened in Firefox, everything is fine at first but reloading the form, or going to another page, is very slow and uses 100% CPU. My guess is that jQuery is removing all the event handlers and that there was a change in how that works between
Move dimensions to core jQuery Library?
The dimensions plug-in seems to be an increasingly-used dependency in plug-ins. Often it's the <i>only</i> dependency. At some point wouldn't it make sense to pull it into jQuery? That would decrease the size of a lot of HTML out there, and speed loading by generating a lot server requests for it.
A bug with globalEval: in jquery 1.2.3
I have a <div> whose html is loaded thru an ajax call. The html that comes back via ajax includes a <script> block that gets run via globalEval: This causes an exception in IE7: ======= var head = document.getElementsByTagName("head")[0] || document.documentElement, ... ... head.appendChild(script); head.removeChild(script); // <- throws an exception (An exception of type "htmlfile invalid argument" was no handled) ======== If I change the first line to var head = document.documentElement, it all
Radio Buttons and Cloning
Hey, I'm trying to clone a section of code that contains radio buttons. I'd like the original section & the cloned section to be in different radio button groups. However, this doesn't seem to be happening with jQuery cloning. I've reduced my code as much as possible to test out the scenario, the code is below. For note, I've tried both the method below (clone, change properties, add to page) as well as the reverse (clone, add to page, change properties). Is there a reason this doesn't work? Is this
Minified/Packed jQuery + Plugins...
This is a question/suggestion w/regards to shrinking jQuery and related plugins. As I understand it, packer replaces variable/functions with short psudeonyms and indexes keywords to be evaluated at runtime, as well as few other tricks. Presumably, this means that there are size + performance gains to be made by (a) including all the scripts you need within one js file that is then packed -OR- by (b) some clever trickery where the same index of keywords/functions/variables could be re-used. Does anyone
jquery on mimeType application/xhtml+xml error
Hello, I created a new layout would like to validate it against xhtml 1.1. It gave me a warning saying: Conflict between Mime Type and Document Type Basically my file is served as a text/html while it expects it to be served as application/xhtml+xml. However after I changed my mimeType to application/xhtml+xml, jquery returned the following error in firebug on firefox An invalid or illegal string was specified" code: "12 I have the latest version 1.2.3. I read a little bit about the conflicts between
Flash content and jQuery
Hello, I was referred to this place by Jörn Zaefferer. I've got problems with having flash content inside the UIAccordion. Basically the problem occurs on Firefox (my Version is 2.0.0.8). The Flash content pops up immediately when activating a corresponding accordion link. It seems as if the flash height attribute isn't handled right. I had to add a height for the containing DIV, otherwise the accordion wouldn't open at all. Instead, the flash content would appear on top of the accordion links beneath.
JQuery on mobile browsers
I would like to use JQuery to build web applications for mobile browsers. i.e. IE Mobile on Windows Mobile 6 (WM6) and S60 WebKit. I tried a few test pages for traversing and manipulating the DOM with JQuery.None of them work on IE Mobile (on a WM6 image) and some of them work on the S60WebKit emulator. They of course all work on IE7, Firefox2.0 and Safari3. On IE Mobile the browser is detected at msie version 6, which isn't quite right. IEMobile on WM6 seems to be somewhere in between IE6 and IE7
Animating multiple elements using step callback (is it recommended?)
I was just looking through the jQuery docs and noticed that animate has a "step" callback option. Is it recommended to use the callback to animate several elements at once? For instance, assume I had 100 DIV tags, the following would produce a noticeable dragging/lagging tail when animating: $("div").css({left:"0"}).animate({left:"70%"},{duration:500}); But if you use the step callback, to animate them at the same time, they stay in a uniform column (no stragglers) because they're all being
Syntax question
I believe that generally this: var divs = document.getElementsByTagName('div'); for(var i=0, k=divs.length; i<k; i++){ divs [i].onclick = doThis; } function doThis(e){ ... } is better than: var divs = document.getElementsByTagName('div'); for(var i=0, k=divs.length; i<k; i++){ divs[i].onclick = function(){ ... } } ... because you're not creating an anonymous function for each div event, just a pointer to the function. Does it therefore follow that this: $('DIV').click(doThis); function doThis(){
Serializing sortables
Hi all, I'm having some trouble using the 'serialize' function for the sortable elements. It looks like the 'update' callback is called before removing the helper element from the list. If you want to get the list order in the update callback you'll end up with an extra element in the list (the helper): $('#mylist').sortable({ update: function(e, ui) { console.debug($(this).sortable('serialize')); /* $.ajax(... */ } }); I also find quite useless the string returned from the 'serialize' command: "my-entry[]=1my-entry[]=4my-entry[]=5my-entry[]=6my-entry[]=3my-
Highlight row in table
Hi, I have want to display to the user a mutually exclusive row to the user. That is only one row is highligted at a time. The user clicks a row and it is highlighted. I have the following code: table.find("td").css({background: "#ffffff"}); table.find("tr").removeClass("hoverrow"); if(!row.hasClass("hoverrow")){ row.addClass("hoverrow"); $.each(row.children("td"), function(){ this.style.background = "#FFF880"; }); }else{ row.removeClass("hoverrow"); $.each(row.children("td"), function(){ this.style.background
"script id=__ie_init defer=true src=//:" probemn for ajax multiple calls
hi i/m working on an admin area made qith jquery. I'm using the load("file.php", function(){ scegliGruppo(); });
removeData for complete namespace
Hi, I just thought it would be useful to have removeData work on a complete namespace if necessary - that would also be consistent to unbind: For the tabs destroy method I need to do following: $(this).unbind('.ui-tabs').removeData('href.ui- tabs').removeData('cache.ui-tabs'); Would be nice to just have: $(this).unbind('.ui-tabs').removeData('.ui-tabs'); First I tried that intuitively without success. --Klaus
Question about Low Pro & klass() & the Core
Greetings, Just wanted to ask the core-developers if they've ever thought about integrating into the core a method like Dan Webb's klass() in his new Low Pro for jQuery plugin, or something like what John wrote about here: http://ejohn.org/blog/simple-class-instantiation/ It seems like a general method for doing this would come in handy as a utility method. Pax, - Stan
Strange problem after install Drosera+WebKit
<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "> Hi all,<div>I'm hoping someone can tell me I'm crazy but I've lost 3 days to this problem before posting here for some insight...</div><div><br class="webkit-block-placeholder"></div><div>Hoping to get some apps working on 'not-firefox' I installed Drosera+WebKit to hopefully help me identify an issue on safari.</div><div>It didnt help much and I eventually figured out the issue though other
A check for trac tickets
Set to Fixed 1595: r4359 1253: r4162 Set to Won'tfix 1681: 1753: Not support xml file 1867: 2035: nonsupport browser version 2029: 2128: more info here: http://blogs.msdn.com/xmlteam/archive/2006/10/23/using-the-right-version-of-msxml-in-internet-explorer.aspx Set to Worksforme 2244: 2119: needs explicit DOCTYPE claim? Set to Duplicate 2146: 2147 Need fix 760: .css('fontSize'); fails in IE when set "body {font: 68.75%/1.366 Verdana, Tahoma, Arial, Helvetica, sans-serif;}" 1271: (or fixed yet?) 2099:
handling elements and events in other documents ?
I remember jQuery was the first to implement this adjustment: http://blog.outofhanwell.com/2006/07/03/cross-window-events/ sorry to bring back this old thing, probably a thing of the past, but since I was looking to the events (again) I saw that the old method of grabbing the event from it's origin window source in IE has been abandoned. Event is always sourced from the window where jQuery has been loaded (window.event). Was the above method ditched in favor of a better approach or was it just forgotten
Reducing the size of jquery via "pick&choose"
Hi guys, I've been using jquery for a while now. I've used Prototype & mootools in the past but being the optimizer that I am, I was so impressed by the tiny size and the elegance of jquery . Size is probably one of the reasons a lot of developers jumped onto the Jquery bandwagon but I am positive that we could take it to a new level by further size reduction. When approaching this problem, I noticed a lot of developers will suggest packing Jquery with either Packer or JSMIN then serving it with
Next Page