Is it possible to use jQuery in a second window on my page? I've tried something like this:
var $ = document.parent.$;
But that doesn't seem to work. Any other ideas? I can't load the framework again.
Thanks!
Is it possible to use jQuery in a second window on my page? I've tried something like this:
var $ = document.parent.$;
But that doesn't seem to work. Any other ideas? I can't load the framework again.
Thanks!
when its in a frame or external window then the library needs to be in that HTML, even if you load() html in through a modal dialog. This is the case if your using jquery/javascript within those elements to manipulate anything outside of them. If your not and all you wish to do is do something from the main window to the child windows frame or otherwise you would have to name the windows/frames.
Reason I say this is cause the DOM is already rendered at that point. You can add javascript dynamically as well with javascript after the DOM is rendered but for the sake of ease I would go with the above mentioned, as theres no real harm calling in jquery more than ones in a scenario like this, or at least no harm I can think of at the moment
On the same note this will also be helpful for you most likely as well: