Make selectors work across iframes
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.
Change History (5)
Resolution: |
→ invalid
|
Status: |
new →
closed
|
I can add that some people asked me how to scroll (using scrollTo/localScroll) to items in iframes when links on parent win are clicked. This would do the trick.
There are some restrictions with cross domain iframes, right ? that needs to be taken into account.