[jQuery] Re: jquery 1.2 unbind problem
There is a conversation in the dev list about this problem. I've created a ticket according to the discussion. http://dev.jquery.com/ticket/1731 Related tickets are #1697 http://dev.jquery.com/ticket/1697, #1618http://dev.jquery.com/ticket/1618and #1610 http://dev.jquery.com/ticket/1610. On 9/30/07, John Resig [EMAIL PROTECTED] wrote: That's correct - there's a ticket open on it (the default handler isn't released, for some reason). We haven't figured out if this only occurs on the document or if it occurs on all elements yet - but for now, it only seems to happen on the document. Here's the ticket: http://dev.jquery.com/ticket/1610 In the future, you should probably bring stuff like this up to the dev list: http://groups.google.com/group/jquery-dev Thanks! --John On 9/29/07, radoslaw wesolowski [EMAIL PROTECTED] wrote: Hello, I've probably found a strange bug in jQuery 1.2 and 1.2.1, which creates high CPU usage. To reproduce it just create site like this one: html head script type=text/javascript src=http:// jqueryjs.googlecode.com/files/jquery-1.2.1.pack.js/script script type=text/javascript src=http://dev.iceburg.net/ jquery/jqDnR/jqDnR.js/script script type=text/javascript $(document).ready(function(){ $(#drawing).jqDrag(); }); /script /head body div style=position:relative;left:50px;top: 50px;display:block;background-color:red; width: 50px; height: 50px; id=drawing/ /body /html or visit http://rwesolowski.jogger.pl/files/test-1-2.html . Then drag and drop a few times the red box, and next just move mouse around the site and watch CPU usage (it's note a problem with jqDnR plugin, i've tested this with some others, and the result was the same). When jQuery 1.1.4 is used everything is OK (check http://rwesolowski.jogger.pl/files/test-1-1.html). According to the Firebug mousemove event is not released after dropping, and what's more on each event jQuery calls extend() method. Radek -- Arrix
[jQuery] Re: document.ready in an ajax response
document.ready won't trigger anymore after the page has been loaded. See http://dev.jquery.com/ticket/904 So avoid $(document).ready() in ajax response snippet. new function() { alert('Hi') } You are actually creating a new instance using an anonymous constructor. The constructor is invoked while evaluating the argument for ready(). On 9/29/07, Curtis Spencer [EMAIL PROTECTED] wrote: Hi, I have a page that makes an Ajax request that gets a a snippet of html that includes the following tag: script type=text/javascript //![CDATA[ $j(document).ready(function() { alert('Hi') }); //]] /script Nothing happens in this case. However, if i change the tag to this: script type=text/javascript //![CDATA[ $j(document).ready(new function() { alert('Hi') }); //]] /script The alert happens. Can someone please illustrate the difference, and why the first one doesn't work? All the examples I see of $ (document).ready never has the new in front of function. Also, is this the right way to call jquery from an ajax response. The parent doesn't necessarily know what is going on in this child, so I can't put it in the success handler of the ajax get call. Thanks, Curtis -- Arrix
[jQuery] $('tagname/') syntax in IE
In IE, $('div/') is ok but $('span/') always returns an empty set. It seems that tagname/ syntax is only ok for block elements. So it's safer to always use $('tagname/tagname') syntax for elements that requires a closing tag. -- Arrix
[jQuery] Re: $('tagname/') syntax in IE
In IE, $('tagname/') fails with these elements A ABBR ACRONYM B BASEFONT BDO BIG BODY CENTER CITE CODE DEL DFN EM FONT FORM H1 H2 H3 H4 H5 H6 HEAD HTML I INS KBD LABEL MAP Q S SAMP SMALL SPAN STRIKE STRONG SUB SUP TITLE TT U VAR IE is such an odd browser. -- Arrix
[jQuery] Re: [bug]removeClass('') removes all classes
Glad to see the trac up and running:-) Ticket created herehttp://dev.jquery.com/ticket/1167. On 5/11/07, John Resig [EMAIL PROTECTED] wrote: The bug tracker is back up again - feel free to add this as a bug! --John On 5/9/07, John Resig [EMAIL PROTECTED] wrote: I agree then, it is inconsistent. Once I get the bug tracker up, this should go in. --John On 5/9/07, Arrix [EMAIL PROTECTED] wrote: The .removeClass() behavior is good. But I don't think .removeClass() should remove every class. Though it doesn't make sense to write .removeClass(), sometimes the parameter passed to .removeClass is a variable $('#someId').removeClass(classToRemove); classToRemove may be set to by previous code and that will destroy the page styles completely. One way to avoid the issue is to check against accidental $('#someId').removeClass(classToRemove || ); On 5/10/07, John Resig [EMAIL PROTECTED] wrote: No, that's expected. removeClass() was re-worked such that .removeClass(one) would remove one class, .removeClass(one two) would remove two classes, and .removeClass() would remove all classes. This is very similar to how .unbind() works (if you call it with no arguments, it removes all bound events). Although, I'm not sure if you're differentiating between .removeClass() and .removeClass(). If that's the case, then it is possible that the first one should, in fact, remove no classes. (Since the method is being called with an argument.) --John On 5/9/07, Arrix [EMAIL PROTECTED] wrote: $('#id').removeClass(''); In the svn edge version Calling removeClass with an empty string as className will remove all classes. It's expected to remove nothing. The trac is not back yet so I'm reporting bug here. -- Arrix -- Arrix -- Arrix
[jQuery] [bug]removeClass('') removes all classes
$('#id').removeClass(''); In the svn edge version Calling removeClass with an empty string as className will remove all classes. It's expected to remove nothing. The trac is not back yet so I'm reporting bug here. -- Arrix
[jQuery] Re: [bug]removeClass('') removes all classes
The .removeClass() behavior is good. But I don't think .removeClass() should remove every class. Though it doesn't make sense to write .removeClass(), sometimes the parameter passed to .removeClass is a variable $('#someId').removeClass(classToRemove); classToRemove may be set to by previous code and that will destroy the page styles completely. One way to avoid the issue is to check against accidental $('#someId').removeClass(classToRemove || ); On 5/10/07, John Resig [EMAIL PROTECTED] wrote: No, that's expected. removeClass() was re-worked such that .removeClass(one) would remove one class, .removeClass(one two) would remove two classes, and .removeClass() would remove all classes. This is very similar to how .unbind() works (if you call it with no arguments, it removes all bound events). Although, I'm not sure if you're differentiating between .removeClass() and .removeClass(). If that's the case, then it is possible that the first one should, in fact, remove no classes. (Since the method is being called with an argument.) --John On 5/9/07, Arrix [EMAIL PROTECTED] wrote: $('#id').removeClass(''); In the svn edge version Calling removeClass with an empty string as className will remove all classes. It's expected to remove nothing. The trac is not back yet so I'm reporting bug here. -- Arrix -- Arrix