Change the onclick event handler into a jQuery .live() event and
you'll be fine for sure.
On Aug 26, 1:57 pm, oleOhle wrote:
> OK, thanks everybody! I think I understand.
>
> Actually my second attempt could easily be rewritten to match exactly
> what jQuery does. It really boils down to the rem
OK, thanks everybody! I think I understand.
Actually my second attempt could easily be rewritten to match exactly
what jQuery does. It really boils down to the remove() function, which
does some magic to remove data and events related to the contained DOM
elements. Since I only have one HTML onCl
"What is jQuery doing to empty an element?"
That's so easy to see/find-out for yourself
open up the jquery.js file, search for "emtpy" and voila
empty: function() {
// Remove element nodes and prevent memory leaks
jQuery(this).children().remove();
// Remove
.empty and .html looks in every node that it removes/replaces and
checks for and removes event bindings in order to prevent memory
leaks. If you know you do not have bound events, first use plain old
javascript to set element.innerHTML = ''; and then remove/replace the
element using .empty()/.htm
I've found something that worked a faster to empty something when I
tested it.
function replaceHtml(el, html) {
var oldEl = typeof el === "string" ? document.getElementById(el) :
el;
if (oldEl == null) return null;
var newEl = oldEl.cloneNode(false);
newEl.innerHTM
That explains my issue very well and will save me a lot of headaches.
(and gives a few ideas for a debug plugin)
thank you
-Olivier
Ricardo wrote:
Could not make much sense out of your video either :D
The thing is: when you log an object or element in firebug, it's just
a reference to the ob
Could not make much sense out of your video either :D
The thing is: when you log an object or element in firebug, it's just
a reference to the object itself, not a snapshot of it at that instant
in time. It will always show the object as it is *now*. Try this in
the console:
x = {a:1};
console.l
Ricardo wrote:
On May 4, 11:33 am, Olivier Percebois-Garve
wrote:
Hi
I'm puzzled with this :http://pastebin.me/49fef93928aff
(in firebug click on the jquery object, then expand "0")
Using empty() or remove() on the lis of a ul, it seems that jQuery is
"faking" to remove them,
i.e the lis
On May 4, 11:33 am, Olivier Percebois-Garve
wrote:
> Hi
>
> I'm puzzled with this :http://pastebin.me/49fef93928aff
>
> (in firebug click on the jquery object, then expand "0")
>
> Using empty() or remove() on the lis of a ul, it seems that jQuery is
> "faking" to remove them,
> i.e the lis will
this is probably due to the refresh problems in firebug
On May 4, 7:33 am, Olivier Percebois-Garve
wrote:
> Hi
>
> I'm puzzled with this :http://pastebin.me/49fef93928aff
>
> (in firebug click on the jquery object, then expand "0")
>
> Using empty() or remove() on the lis of a ul, it seems that
It has to do more than just set innerHTML to a blank string to avoid memory
leaks. :(
--
Brandon Aaron
On Thu, Nov 6, 2008 at 6:28 PM, jquertil <[EMAIL PROTECTED]> wrote:
>
> thanks Karl,
>
> didn't make a difference. I suppose I'll have to preload everything
> and show/hide things... ugh.
>
> do
thanks Karl,
didn't make a difference. I suppose I'll have to preload everything
and show/hide things... ugh.
does empty() go through the entire element node tree and remove things
one by one or something? I kept thinking it just sets innerHTML=''.
Try making the selector more specific. So instead of $('.full') use
$('div.full').
Karl Rudd
On Fri, Nov 7, 2008 at 11:19 AM, jquertil <[EMAIL PROTECTED]> wrote:
>
> if I have a lot of elements inside ...
>
> and then do $('.full').empty().append ('blah');
>
> it takes a long time. Is there a wa
> I have the following on a JQuery Code:
>
> $('').appendTo('#Themes')
> .append(subject)
> .append('')
> .append(levels)
> .append('')
>
> How can I add
>
> .append(subject)
> .append('')
>
> only if subject is not empty and
>
> .append(levels)
> .append('')
>
> only if
No Richard, that's a bug on jQuery.attr, undefined is returned instead
of ''.
'class' works as well as 'className'.
I hope this gets revised, it's one of the fixes of on this ticket:
http://dev.jquery.com/ticket/2548
Cheers
--
Ariel Flesler
http://flesler.blogspot.com
On 12 mayo, 09:01, "Ric
The name of the class attribute is className, so you want:
$('#myid').attr('className');
- Richard
Richard D. Worth
http://rdworth.org/
On Sun, May 11, 2008 at 12:48 PM, Adwin Wijaya <[EMAIL PROTECTED]>
wrote:
>
> I have code .. to check what class in every id ..
>
> i found that if the class=
On Dec 4, 2007, at 12:23 AM, Christoph Roeder wrote:
Thanks, I think this is much better.
Chris
On Dec 3, 3:03 pm, Karl Swedberg <[EMAIL PROTECTED]> wrote:
Does that help clarify it? If not, feel free to edit it directly in
the wiki or reply to this with a suggestion for revision.
excelle
Thanks, I think this is much better.
Chris
On Dec 3, 3:03 pm, Karl Swedberg <[EMAIL PROTECTED]> wrote:
> Does that help clarify it? If not, feel free to edit it directly in
> the wiki or reply to this with a suggestion for revision.
It's not a bug in :empty. I just changed the documentation to this:
Matches all elements that have no children (including text nodes).
Then, for the "demo" tab, I changed it to this:
Finds all elements that are empty - they don't have child elements or
text.
Does that help clarify
19 matches
Mail list logo