[jQuery] Re: Lookup doesn't work within HTML loaded with .load()

2007-10-25 Thread Danny Wachsstock
.load is asynchronous, which means that it returns (and the next statement is executed) before it finishes loading. So $("#left").load("test.html"); starts loading #left with test.html but $("#left").css("border","1px solid red"); executes within milliseconds, and test.html probably hasn't

[jQuery] Re: .attr()

2007-05-01 Thread Danny Wachsstock
You don't even need to explicitly accumulate the result: $.fn.attrs = function(key, val) { if (val != undefined) return this.attr(key, val); return $.map(this, function(a) { return $(a).attr(key); }); }; Danny malsup wrote: > > Good catch, Jörn! > >> You don't even need th