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) {
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
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
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
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
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
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,
7 matches
Mail list logo