Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Feature Request: Allow jQuery mobile to define context document #7440

Closed
jodator opened this issue May 28, 2014 · 2 comments
Closed

Feature Request: Allow jQuery mobile to define context document #7440

jodator opened this issue May 28, 2014 · 2 comments

Comments

@jodator
Copy link

jodator commented May 28, 2014

It would be nice to apply context for jQuery mobile or reuse jQuery mobile object to initialize jQuery mobile on other document (ie. inside iframe).

Use case: Let say some one have a jQuery mobile application that is inserted in a webpage as a widget by an iframe. Application script loader can detect if ther are any of required libraries on parent page and inject them to App's iframe document so there will be no need to attach jQuery mobile twice (one on parents webpage and second on App page inside an iframe).

Currently builded jQuery mobile script does not allow to "clone" jQuery mobile object to other document nor to initilaize a second instance of jQuery mobile app since it is bound to one document.

For instance, jQuery can be "reused" since it can have given context like: $("#myId", iframe.contentDocument);

@gabrielschulhof
Copy link

This is an excellent point. We make far too much use of document and window in the library. It's part of our design limitations.

In contrast, the jQuery UI widget factory, when used correctly, explicitly provides each widget instance with its window/document context. So, we can either make use of this facility in future versions of jQuery Mobile, or we can at least thread the context awareness you request into the library by some other means.

Either way, this is a fairly involved task. I wouldn't consider it a feature request though, because it is in some sense an architectural flaw of the library. Nevertheless, whether we qualify this as a feature request or not is up for some discussion.

@gabrielschulhof gabrielschulhof added this to the 1.5 - 2.0 milestone May 28, 2014
@jaspermdegroot jaspermdegroot removed this from the 1.5 - 2.0 milestone May 29, 2014
@jaspermdegroot
Copy link
Contributor

@jodator

Thanks for the feature request. We discussed it during our weekly meeting. To implement something like this in navigation (managing multiple history stacks) is very complicated. There is still a lot of work to be done on navigation before we can even think of implementing this and there is a big chance we decide not to do it because it is too complex.
I am closing this ticket as feature request. Thanks for your contribution!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants