用JS来实现iframe 的标准化.
一、建立一个JS文件,代码如下:
function ifr(url,w,h){document.write('<iframe id="ifr" name="ifr" width="'+w+'" height="'+h+'" border="0" frameborder="0" scrolling="no" src="'+url+'"></iframe>');}
保存成"ifr.JS"
二、在网页中插入代码
<script type="text/JavaScript" src="ifr.JS"></script>
三、在需要使用iframe的地方插入代码
<script type="text/JavaScript">ifr('http://www.51fy.cn/','778','120');</script>
函数ifr()使用说明:ifr('这里写地址','这里写宽度','这里写长度',)