开发者

How do I disable scripts in my iframe? [duplicate]

开发者 https://www.devze.com 2023-01-18 21:17 出处:网络
This question already has answers here: Disable JavaScript in iframe/div (4 answers) Closed 9 years ago.
This question already has answers here: Disable JavaScript in iframe/div (4 answers) Closed 9 years ago.

I have an iframe that loads a page that I would like to disable the javascripts loading in the iframe loaded page. The loaded page has menu bars, dropdowns, etc. that make the home page that I am loading this iframe from load slow. Is there a way to disable javascript from my iframe page?

I need the javascripts to remain in the page because the visitor can visit the page.

Here is my code for loading the iframe:

<div style="position:absolute; overflow:hidden; width: 800; height:400; left:-170px; top:0px;">
<iframe src="/News/Pages/Default.aspx" style="overflow:hidden; width:100%; height:650;"
      frameborder="0" marginheight="0" marginwidth="0" scrolling="no">
</iframe>开发者_StackOverflow;</div>

If this is not possible, than is there a way to stop/disable the iframe page from loading the .js files. The iframe page loads .js files, no javascript is inline.


Check out the last code example on this page, http://www.iframehtml.com/iframe-scripts.html

Shows a method of stripping JavaScript from the iframe's source file using PHP


As far as I am aware, I dont think you can disable loading of javascripts in the Iframe. Best way is, avoid script tags in the iframe page.

0

精彩评论

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