On May 9, 12:50 pm, [EMAIL PROTECTED] wrote:
> For now, I've opted for the following:
>
> var container = $(settings.container);
> if (!container.parent().parent().size()) {
> // settings.container must not be an existing page element,
> // so insert it into the DOM
> ...
>
> }

Frustratingly enough, this logic broke IE7.

IE7: $("<em>").parent().parent().size() = 1
FF: $("<em>").parent().parent().size() = 0

So now I'm switching back to a regex check on settings.container:

// if settings.container doesn't match HTML tag format:
// "<em>", "<div id='foo'></div>", etc.
// then assume it's an existing DOM element

var container = (!settings.container.match(/^<.+>$/))
                                ? $(settings.container)
                                        : $(settings.container)
                                                .insertAfter(this)
                                                        
.addClass(settings.classname);

I've updated my site with this fix, plus one other minor bug fix.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery (English)" group.
To post to this group, send email to jquery-en@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jquery-en?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to