What I do is apply a context to the function called by document.ready, and
use that context in all of the calls I make in it. Then, on load()'s
complete, I pass the stuff being updated into that method.
docReady = function(cx) {
cx = cx || document;
$("tr:odd", cx).addClass("odd")
}
$(docReady);
$("#container").load(url, function(html) { docReady(html) })
Something like that should work :-D
-- Yehuda
On 1/18/07, Jörn Zaefferer <[EMAIL PROTECTED]> wrote:
tmcw schrieb:
> Does jQuery automatically update the DOM after new content is loaded via
the
> .load() function? It seems like it's working in some cases and failing
on
> others right now. If not, is there a way to manually update it? I'm
binding
> a function to links with a certain class on document.ready, but when new
> links are loaded in, they don't trigger the function.
>
You have to reapply the event bindings to elements that you add later to
the DOM, like the ones loaded via load().
See also http://www.learningjquery.com/2006/09/sacrificial-lambda
--
Jörn Zaefferer
http://bassistance.de
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/
--
Yehuda Katz
Web Developer | Wycats Designs
(ph) 718.877.1325
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/