让iframe符合W3C标准

[ 2007-08-10 11:13:14 | Author: zhenhua ]
Font Size: Large | Medium | Small
用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('这里写地址','这里写宽度','这里写长度',)
Comments Feed Comments Feed: http://www.zhenhua.org/feed.asp?q=comment&id=471
UTF-8 Encoding Trackback URL: http://www.zhenhua.org/trackback.asp?id=471

There is no comment on this article.

If you feel this site you find this information helpful, please click on the donation, which is voluntary,Thank you.
Post Comment
Smilies
[arrow] [biggrin] [confused] [cool]
[cry] [eek] [evil] [exclaim]
[frown] [idea] [lol] [mad]
[mrgreen] [neutral] [question] [razz]
[redface] [rolleyes] [sad] [smile]
[surprised] [twisted] [wink]
Enable UBB Codes
Auto Convert URL
Show Smilies
Hidden Comment
Username:   Password:   Register Now?
Security Code * Please Enter the Security Code