[jquery-dev] Re: attr() is still very broken in 1.4a1

2009-12-16 Thread Robert Katić
I have to correct my correcting: Both .attr({"height": "180"}) and .attr("height", "180") will call .height(). Still there still is big discrepancy between .attr({ click: function(){/*..*/} }) and .attr("click", function(){/ *..*/}) Adding that there is no (for now) symmetry between attr("height"

[jquery-dev] Re: attr() is still very broken in 1.4a1

2009-12-16 Thread Robert Katić
> > If we have > > >  $(xml).find("foo").attr("height", "180cm") > > > then you would expect calling elem.setAttribute() and not .height(), I > > hope. > > If so, there is a bug in jQuery.attr()... > > So we could disable it on XML documents - but regardless, that is > definitely th exception. I h

Re: [jquery-dev] Re: attr() is still very broken in 1.4a1

2009-12-16 Thread John Resig
> I would note some problems (2): > > If we have > >  $(xml).find("foo").attr("height", "180cm") > > then you would expect calling elem.setAttribute() and not .height(), I > hope. > If so, there is a bug in jQuery.attr()... So we could disable it on XML documents - but regardless, that is definite

Re: [jquery-dev] Re: $.fn.contains is not consistent with :contains

2009-12-16 Thread Rick Waldron
John, I tend to assume that anything prefixed with 'is' or 'has' will return a boolean. I think this is likely a common assumption. Rick -- Sent from my Palm Prē ajpiano wrote: I meant people are used to using $(foo).anyfiltermethod().length. Glad to see .contains() is gone until it can be all

[jquery-dev] Re: $.fn.contains is not consistent with :contains

2009-12-16 Thread ajpiano
I meant people are used to using $(foo).anyfiltermethod().length. Glad to see .contains() is gone until it can be all it can be. As it was, .contains was just a shortcut to .is(":has(foo)") On Dec 16, 11:14 pm, John Resig wrote: > People are use to using .has()? It was only just added - at the s

[jquery-dev] Re: a bug in jQuery.fn.ready

2009-12-16 Thread helianthus
OK I just found out why. One of my project is a cross-browser userscript. Since GreaseMonkey runs userscripts only after the DOM is ready, I set jQuery.isReady to true when GreaseMonkey is detected, and that causes the function stacks never fired. Now I realize jQuery.ready() is probably the corre

[jquery-dev] Re: attr() is still very broken in 1.4a1

2009-12-16 Thread Robert Katić
I would note some problems (2): If we have $(xml).find("foo").attr("height", "180cm") then you would expect calling elem.setAttribute() and not .height(), I hope. If so, there is a bug in jQuery.attr()... Other think to take in consideration is that $("div").attr("click", function(){ /*..*

Re: [jquery-dev] $.fn.contains is not consistent with :contains

2009-12-16 Thread John Resig
People are use to using .has()? It was only just added - at the same time as .contains() as well. I'll mull over the .contains() discrepancy. I may just punt it and push people towards .has() anyway. Looking at .has() now I'm not 100% sure why it's filtering and not just returning a boolean, like

Re: [jquery-dev] Re: a bug in jQuery.fn.ready

2009-12-16 Thread John Resig
It shouldn't make much difference either way but I moved the check. The result should be a bit clearer now: http://github.com/jquery/jquery/commit/9a0174b057ae58735c3c5f595e420c7bb1db038c --John On Wed, Dec 16, 2009 at 11:02 PM, helianthus wrote: > But my code broke after switching from 1.4a1

[jquery-dev] $.fn.contains is not consistent with :contains

2009-12-16 Thread ajpiano
It seems like a matter of course that means of filtering that are exposed as both pseudoselectors and methods on the jQuery prototype return the same set of elements, or at least that they generally apply the same principle in filtering. Examples include eq, not, first, last, and has. While the :

[jquery-dev] Re: a bug in jQuery.fn.ready

2009-12-16 Thread helianthus
But my code broke after switching from 1.4a1 to 1.4a2... and removing that check fixed it. I guess I have to check again what broke my code then. On Dec 17, 11:25 am, John Resig wrote: > That's not true - readyList is set to null inside of jQuery.ready() > once the queue has been emptied (the log

[jquery-dev] Re: Bug in jQuery 1.4a1 focus()

2009-12-16 Thread Devon Govett
Awesome! Thanks! Devon On Dec 16, 10:23 pm, John Resig wrote: > Thanks for the test case, this is actually already fixed and in the > latest nightly:http://code.jquery.com/jquery-nightly.js > > --John > > > > On Wed, Dec 16, 2009 at 9:54 PM, Devon Govett wrote: > > Hello, > > > I have found a b

[jquery-dev] jQuery require and script loaders

2009-12-16 Thread James Burke
I heard about the jQuery require that is shown as part of this changeset: http://github.com/jquery/jquery/commit/998cb005fc378188b3bae319e391d1b7881b7ad2 I work on Dojo's module loader, and have a new standalone (no other library dependency) script loader here: http://code.google.com/p/runjs/wiki/

[jquery-dev] Key Event Handling

2009-12-16 Thread Clifford Heath
Folk, I'm using JQuery 1.3.2 with a RaphaelJS application to produce a graphical drag/drop diagram drawing tool. See my Raphalle project on github for the D&D library. I have issues with the fact that on an VML text object, jQuery's registration of mouse event handlers doesn't work, where

Re: [jquery-dev] a bug in jQuery.fn.ready

2009-12-16 Thread John Resig
That's not true - readyList is set to null inside of jQuery.ready() once the queue has been emptied (the logic hasn't changed from when the ready method was in event.js). --John On Wed, Dec 16, 2009 at 9:06 PM, helianthus wrote: > At line 223 of core.js, > readyList is an array, which will nev

Re: [jquery-dev] Bug in jQuery 1.4a1 focus()

2009-12-16 Thread John Resig
Thanks for the test case, this is actually already fixed and in the latest nightly: http://code.jquery.com/jquery-nightly.js --John On Wed, Dec 16, 2009 at 9:54 PM, Devon Govett wrote: > Hello, > > I have found a bug in the focus() function in jQuery 1.4.  The focus() > function simply does no

Re: [jquery-dev] jQuery/FireFox selection bug

2009-12-16 Thread John Resig
Well, if XML is coming from a server it should already be XML - especially if you're getting it from an $.ajax() request (or the like). That is definitely the preferable way to get XML from a server. --John On Wed, Dec 16, 2009 at 9:58 PM, John Arrowwood wrote: > Well, technically, I'm pulling

[jquery-dev] .css('border-style') not working in FireFox 3.5.5 (Mac), jQuery 1.3.2

2009-12-16 Thread jarrowwx
I have a set of qunit tests for my JavaScript that I am creating. On Safari 4.0.4 (Mac), I do this: $(elem).css({ 'border-style':'outset' }); console.log( $(elem).css('border-style') ); // prints 'outset' On FireFox, the same code produces an empty string. Is it me? -- You received this mess

Re: [jquery-dev] jQuery/FireFox selection bug

2009-12-16 Thread John Arrowwood
Well, technically, I'm pulling the XML from a server, and then using document.createElement() to create the 'state' and 'foo' tags. But I tried to simplify the situation to the minimum. Should I be using a different technique to create the XML tags/nodes, and would that solve my problem? On Wed,

[jquery-dev] Bug in jQuery 1.4a1 focus()

2009-12-16 Thread Devon Govett
Hello, I have found a bug in the focus() function in jQuery 1.4. The focus() function simply does nothing in jQuery 1.4a1 when trying to trigger the event. For example: $("input").focus(); This does nothing. In jQuery 1.3.2, this would focus the input field. Here is a test page: http://dl.dr

[jquery-dev] a bug in jQuery.fn.ready

2009-12-16 Thread helianthus
At line 223 of core.js, readyList is an array, which will never be falsy, so the block will never be executed. -- You received this message because you are subscribed to the Google Groups "jQuery Development" group. To post to this group, send email to jquery-...@googlegroups.com. To unsubscribe

Re: [jquery-dev] jQuery/FireFox selection bug

2009-12-16 Thread John Resig
I'm curious to hear if this has been resolved in jQuery 1.4a1, it may be. http://code.jquery.com/jquery-nightly.js I should note that in your case you're not actually creating an XML fragment - you're creating a bunch of unknown HTML elements. --John On Wed, Dec 16, 2009 at 3:02 PM, jarrowwx

Re: [jquery-dev] Re: Mutation Events

2009-12-16 Thread Mark Gibson
I developed a plugin to trigger events when various jQuery functions are called, it currently supports attr, data, val, and html: src: http://github.com/jollytoad/jquery.mutation-events docs: http://www.adaptavist.com/display/jQuery/Mutation+Events The actual events follow the MutationEvent API.

[jquery-dev] jQuery/FireFox selection bug

2009-12-16 Thread jarrowwx
I have a snippet of XML. var xml = $('1')[0]; On Safari, this works: console.log( $(xml).find('card foo').text() ); // prints '1' On FireFox, it does not (returns empty string), but this works: console.log( $(xml).find('card').find('foo').text() ); // prints '1' I've worked around it. But

Re: [jquery-dev] Re: attr() is still very broken in 1.4a1

2009-12-16 Thread Rick Waldron
So... that example still doesn't use: *.attr('onclick', function() { /.../ }); * * * But I see where you're coming/going with this (as far as purpose, not syntax). It simply adds more credence to my point, as it's getting/testing a value, not setting. * * Rick * * On Wed, Dec 16, 2009 at 12:5

Re: [jquery-dev] Re: attr() is still very broken in 1.4a1

2009-12-16 Thread Robert E. Rothermel III
Line 688... I saw it because I was trying to use .live() and this check shot that to pieces... If the link doesn't pass this check it's assumed to not be a Highslide link, even if the link has the "highslide" class applied. isHsAnchor : function (a) { return (a.onclick && a.onclick.toString

Re: [jquery-dev] Re: attr() is still very broken in 1.4a1

2009-12-16 Thread John Resig
I think these lines, for example: isHsAnchor : function (a) { return (a.onclick && a.onclick.toString().replace(/\s/g, ' ').match(/hs.(htmlE|e)xpand/)); }, That is some awful, awful, code. Considering that this code in no way uses jQuery I don't see how making the changes would cause any

Re: [jquery-dev] Re: attr() is still very broken in 1.4a1

2009-12-16 Thread Rick Waldron
I've searched the source... maybe I missed it, but I cant find your example... http://highslide.com/highslide/highslide-full.js Rick On Tue, Dec 15, 2009 at 5:03 PM, Robert E. Rothermel III < thirden...@gmail.com> wrote: > The only time that I

[jquery-dev] Re: Mutation Events

2009-12-16 Thread DBJDBJ
Thanks Paul. This (very usefull experiment ) shows mutation events "faking", using jQuery. What I am talking about is jQ 1.5 implementing and relying on mutation events internal "infrastructure" to solve the problems that MutationEvents are solving : CRUD operations on the persistent storage (dom d

Re: [jquery-dev] Timers in the jQuery core?

2009-12-16 Thread Michael Geary
I'm curious what you find ugly about setTimeout, and how jQuery could improve on it. I don't see much if any difference between: $(foobar).click( function() { // called on click }); and: setTimeout( function() { // called on timeout }, 1000 ); They look like extremely similar styles of

Re: [jquery-dev] unrecognized expression error

2009-12-16 Thread Rick Waldron
That's odd, I copied your snippet exactly as shown, and reproduced the error. Then i escaped it as you mentioned and it works perfectly (this, changed the text next to the input to say "my:txtPhone") $("input[xd\\:binding = 'my:txtPhone']") On Wed, Dec 16, 2009 at 5:39 AM, Ravindra wrote:

[jquery-dev] Re: Mutation Events

2009-12-16 Thread Paul Irish
DBJ, Mutation events are supported in FF (as of v2, I believe), despite what that table had said. https://developer.mozilla.org/En/DOM_Client_Object_Cross-Reference/DOM_Events And you can bind with the normal bind. jQuery('.container').bind('DOMSubtreeModified',function(e){ console.log(this,arg

Re: [jquery-dev] Re: attr() is still very broken in 1.4a1

2009-12-16 Thread Robert E. Rothermel III
The only time that I can think of where one would want to use .attr('onclick', function() { /.../ }); is Highslide... it actually runs a regex on each A tag to see if the string "hs.expand" is in the onclick attribute. Rick Waldron wrote: > I've been reading this thread right along and I apolog

[jquery-dev] unrecognized expression error

2009-12-16 Thread Ravindra
Hi, when I give attribute name as “xd:binding”, I gets error as “Error: uncaught exception: Syntax error, unrecognized expression: [xd:binding='my:txtPhone']”. I also tried escaping – [xd\\:binding=’my:txtPhone’], JavaScript error is not coming in this case but unable to select attribute. Please

[jquery-dev] Mutation Events

2009-12-16 Thread DBJDBJ
CHROME supports this ... but FF does not. same as IE8 . http://www.w3.org/2003/02/06-dom-support.html jQuery 1.5 perhaps ? What I am actually talking is jQuery implementing support for "Mutation Events" , which is DOM Level 2 ... http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/events.

Re: [jquery-dev] Timers in the jQuery core?

2009-12-16 Thread Karl Swedberg
On Dec 16, 2009, at 6:42 AM, Tobias Hoffmann wrote: > Hi, > > On Wed, Dec 16, 2009 at 11:04 AM, jez wrote: > It rather surprised me that one of the things I had to turn to a > plugin for was a timer. It seems like the kind of thing that would > frequently be useful to have, abstracted to a

Re: [jquery-dev] Timers in the jQuery core?

2009-12-16 Thread Tobias Hoffmann
Hi, On Wed, Dec 16, 2009 at 11:04 AM, jez wrote: > It rather surprised me that one of the things I had to turn to a > plugin for was a timer. It seems like the kind of thing that would > frequently be useful to have, abstracted to a nice jQuery interface, > rather than using directly the ra

[jquery-dev] Timers in the jQuery core?

2009-12-16 Thread jez9999
Hi, It rather surprised me that one of the things I had to turn to a plugin for was a timer. It seems like the kind of thing that would frequently be useful to have, abstracted to a nice jQuery interface, rather than using directly the rather ugly setTimeout function in Javascript. Why not imple

Re: [jquery-dev] Teardown on plugins

2009-12-16 Thread Jörn Zaefferer
More complete, each widget binds to that remove-event to call its destroy-method. Though due to the event-handling overhead involved, we explored other approaches Jörn On Mon, Dec 14, 2009 at 6:42 PM, John Resig wrote: > jQuery UI does a similar thing (overriding .remove() to generate a > .trig

Re: [jquery-dev] Teardown on plugins

2009-12-16 Thread Jörn Zaefferer
More complete, each widget binds to that remove-event to call its destroy-method. Though due to the event-handling overhead involved, we explored other approaches as well, where an element maintains a list of all widgets... Jörn On Mon, Dec 14, 2009 at 6:42 PM, John Resig wrote: > jQuery UI doe