[jQuery] Re: How to retrieve jQuery.query?

2008-08-31 Thread moester
I had a similar need. Wanted to override the default load() functionality, and needed the original selector. I tried overriding jQuery.init to save the passed in selector, eg, jQuery.fn.extend(jQuery.fn, { _init : jQuery.fn.init, _selector : '', init : function (selector, context) {

[jQuery] an ajax load selector function to replace element

2008-08-29 Thread moester
I kept having to do $('#content').load(url + " #content"); but ended up having What i ready wanted was to completely replace the element with selected content from an ajax load, hence, $('#content).replace(url); /** * ajax load content and replace self * replaced object must have 'i

[jQuery] Re: Selecting text nodes

2008-08-27 Thread moester
May want to look at Ariel Flesler's Translator: http://flesler.blogspot.com/2008/05/textnode-translator-for-javascript.html I used it to write a simple incrementor for numerals within a selected set. jQuery.fn.incr = function(amount, fn) { amount = typeof amount == 'undefined' ? 1 : Number(am

[jQuery] Re: Selecting text nodes

2008-08-27 Thread moester
May want to look at Ariel Flesler's Translator: http://flesler.blogspot.com/2008/05/textnode-translator-for-javascript.html I used it to write a simple incrementor for numerals within a selected set. jQuery.fn.incr = function(amount, fn) { amount = typeof amount == 'undefined' ? 1 : Number(am

[jQuery] Re: JQuery "exists" - anything in core or a plugin that does this?

2008-08-22 Thread moester
I think this is a valid request and the apply() plugin might be what you're looking for. http://plugins.jquery.com/project/jquery_apply

[jQuery] Re: order of arguments reversed on $.map callback function

2008-08-20 Thread moester
Ahh, i wasn't aware there was a jQuery.fn.map -- thanks! (nube mistake). Michael, thanks for pointing out the argument order difference between $.map and $.each. I agree arguing over these historical glitches is a moot point, but I think the docs could point out these glitches/ gotchas/inconsis

[jQuery] order of arguments reversed on $.map callback function

2008-08-19 Thread moester
The argument order of the $.map callback function seems to be reversed depending on how $.map is used. >>> arr = ['a','b','c'] ["a", "b", "c"] >>> $.map(arr,function(n,i){return [n,i]}) ["a", 0, "b", 1, "c", 2]<-- according to docs >>> $(arr).map(function(n,