On my server I am rendering pages that all have the exact same script/ style tags (from the templating on the back end).
And any time I want to create a popup on the site, I create a modal with an iFrame inside of it with the src
set.
This causes all of the script tags to be loaded to the client a second time, with the performance impact expected.
My goal is to have the scripts files for the main DOM to be accessible from within the iFrame without reloading them.
Ideally what I'd be able to do is pass a parameter to the server that tells it not to include the script tags in the rendered HTML, and then "push" those scripts and styles from the client directly into the iFrame.
Is something like this possible to where I can maintain the functionality of document.ready
and other API's while not having to reload all of the scripts and styles from the server?