开发者

Cloning javascript library into iFrame

开发者 https://www.devze.com 2023-04-01 05:08 出处:网络
I\'m creating a popup dialog using jQueryUI. I have run into problems because I\'m using exactly the same blocks of HTML and JavaScript code as on the page. (The application was not designed for that

I'm creating a popup dialog using jQueryUI. I have run into problems because I'm using exactly the same blocks of HTML and JavaScript code as on the page. (The application was not designed for that and I'm not going to recode it deeply). So I have two tags with same ID attributes in the document - on the page and in popup.

To avoid this I decided to open the dialog in an iFrame. Everything works, of course, but the popup opens too slowly (it has a long list of JS and CSS files to load). They are in cache of course, but the browser seems to send requests to check them.

The question: can anything be done as a quick help? I can connect the parent window using Javascript,开发者_如何学Python so can I somehow import, or clone (deep copy), for example, jQuery library? What do you think of it?

(Please don't blame me if the question is crazy)


You don't need to clone jQuery, you may use it also from within the frame.

parent.$('selector', document).someMethod()
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号