如何在iframe中禁用脚本? [英] How do I disable scripts in my iframe?
问题描述
我有一个iframe加载一个页面,我想禁用在iframe加载页面中加载的javascripts。加载的页面有菜单栏,下拉菜单等,使我加载此iframe的主页加载速度变慢。有没有办法从我的iframe页面禁用javascript?
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?
我需要javascripts留在页面中,因为访问者可以访问该页面。
I need the javascripts to remain in the page because the visitor can visit the page.
这是我的加载iframe的代码:
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></div>
如果这是不可能的,那么有没有办法停止/禁用iframe页面加载.js文件。 iframe页面加载.js文件,没有javascript是内联的。
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.
推荐答案
查看此页面上的最后一个代码示例, http://www.iframehtml.com/iframe-scripts.html
Check out the last code example on this page, http://www.iframehtml.com/iframe-scripts.html
显示使用PHP从iframe的源文件中删除JavaScript的方法
Shows a method of stripping JavaScript from the iframe's source file using PHP
这篇关于如何在iframe中禁用脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!