I like it too.
A few points to consider though:
- Could yield unexpected results. You could be matching elements that
you didn't take into account (they're in an iframe that you didn't
create or something like that).
- Maybe browsers will complain when you mix nodes of different windows/
documents ? like if you move a node from one document to the other. Or
use window.defaultView.getComputedStyle on a node from an iframe ?
(just guessing).
- This could affect perfomance. You could be iterating over many more
nodes on every call to the engine. Imagine a $('.foo') on the window
and 2 iframes.
Cheers
--
Ariel Flesler
http://flesler.blogspot.com
On Oct 22, 7:01 am, "Paul Bakaus" <[EMAIL PROTECTED]> wrote:
> Hey guys,
>
> I propose to add navigating through iframes for the immediate next version
> of jQuery.
> That would basically allow you to do stuff like $("iframe div") and fail
> gracefully on iframes you're not allowed to access.
>
> Although I never worked on the selector engine, implementation seems quite
> easy -
> a initial test showed that adding something like
>
> if(ret[i].nodeName.toLowerCase() == "iframe") ret[i] =
> ret[i].contentDocument || ret[i].document;
>
> at line 232 in selector.js would do the job (probably not in all cases
> though). I personally think
> it would be a very valuable addition, and I can see quite a few usecases in
> jQuery UI.
>
> I also duplicated that email and submitted it as a ticket
> here:http://dev.jquery.com/ticket/3509
>
> Yay nay?
>
> Paul Bakaus
> UI Architect
> --http://paulbakaus.comhttp://www.linkedin.com/in/paulbakaus
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---