Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Avoid Multiple jQueries & Boostrap in an iFrame

I have an iFrame where the embedded site uses jQuery plus Bootstrap and my parent site also uses them. Can I remove them in the remote site and rely on my parent website?

Regards

like image 504
Sunny Avatar asked May 10 '26 00:05

Sunny


1 Answers

For the scripts part of bootstrap you can avoid it by using the sandbox attribute of the iframe.

<iframe id="myIframe" sandbox="allow-forms allow-pointer-lock allow-popups allow-same-origin allow-top-navigation">

I don't have a solution for the css part yet.

Otherwise load your content with ajax and then display it by moving the content you loaded to the place you want (jquery helps a lot to do so). It shouldn't load any ressource so.

like image 127
Christophe Avatar answered May 12 '26 13:05

Christophe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!