大家好,帮忙看下这个代码,在IE里面能正常调取src的内容到网页显示,但在火狐里提示"document.all is not a function",并且不能正常显示出来,各位大神,教我。谢谢!document.writeln("<BODY align=center>");
document.writeln("<table width=\"1002\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">");
document.writeln("<tr>");
document.writeln("<td><iframe name=\"Showme\" src=\"/game.asp\" width=1002 height=2500 scrolling=no onload=document.all('Showme').height=Showme.document.body.scrollHeight+0 border=\"0\" frameborder=\"0\" ></iframe><\/td>");
document.writeln("<\/tr>");
document.writeln("<\/table>");
document.writeln("<\/BODY>");
document.writeln("<table width=\"1002\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">");
document.writeln("<tr>");
document.writeln("<td><iframe name=\"Showme\" src=\"/game.asp\" width=1002 height=2500 scrolling=no onload=document.all('Showme').height=Showme.document.body.scrollHeight+0 border=\"0\" frameborder=\"0\" ></iframe><\/td>");
document.writeln("<\/tr>");
document.writeln("<\/table>");
document.writeln("<\/BODY>");
解决方案 »
- jquery easyui combotree 的onSelect事件
- JS中 (new Date()).getMonth()明明是Oct 为什么显示9?
- 过滤特定html标签,高手来看看呢
- 关于WINDOW.OPENER的问题
- 我应该放弃吗?看了风云舞的VML大作真是受刺激了
- 正则(JS)re=new RegExp("^\d*$");与re=/^\d*$/;之间区别?
- iframe中src的页面刷新的问题!!!
- 怎样将javascript中定义变量的值传到下一个页面???
- 在线等待,怎么得到页面实际显示的大小,我要的不是屏幕分辨率,高手快来,谢谢!!!
- 只能0打头,后面0\1\2三个数,不能连续重复的正则表达式
- Jscript调用存储过程怎么传多个参数?
- 请问,如何不让iframe遮挡主窗口中的层?
<html>
<head>
<meta charset="gb2312" />
<title></title>
</head>
<body>
<script>
document.writeln("<BODY align=center>");
document.writeln("<table width=\"1002\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">");
document.writeln("<tr>");
document.writeln("<td><iframe name=\"Showme\" src=\"http://www.baidu.com/\" width=1002 height=2500 scrolling=no onload=document.all('Showme').height=Showme.document.body.scrollHeight+0 border=\"0\" frameborder=\"0\" ></iframe><\/td>");
document.writeln("<\/tr>");
document.writeln("<\/table>");
document.writeln("<\/BODY>");
</script>
</body>
</html>没问题啊。
给iframe弄个id值 ,然后
document.getElementById('Showme')
<!DOCTYPE HTML>
<html>
<head>
<meta charset="gb2312" />
<title></title>
</head>
<body>
<script>
document.writeln("<BODY align=center>");
document.writeln("<table width=\"1002\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">");
document.writeln("<tr>");
document.writeln("<td><iframe name=\"Showme\" id=\"Showme\" src=\"http://www.baidu.com/\" width=1002 height=2500 scrolling=no onload=document.getElementById('Showme').height=Showme.document.body.scrollHeight+0 border=\"0\" frameborder=\"0\" ></iframe><\/td>");
document.writeln("<\/tr>");
document.writeln("<\/table>");
document.writeln("<\/BODY>");
</script>
</body>
</html>改下 getElementById 就可以了。
楼主要 iframe自适应高度的话,搜下吧,很多相关信息的。