| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1161 人关注过本帖
标题:【求助】大侠,帮我看看这段javaScript代码
只看楼主 加入收藏
daliboy
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2004-10-1
收藏
 问题点数:0 回复次数:5 
【求助】大侠,帮我看看这段javaScript代码
Script language="JavaScript">
function createSummary(){
   win2=open("","window2")
   win2.document.open("text/plain")
   win2.document.writeln("Title: "+document.title)
   win2.document.writeln("Links: "+document.links.length)
   win2.document.writeln("anchors: "+document.anchors.length)
   win2.document.writeln("forms: "+document.forms.length)
   win2.document.writeln("images: "+document.images.length)
   win2.document.writeln("applets: "+document.applets.length)
   win2.document.writeln("embeds: "+document.embeds.length)
   win2.document.close()
}
</script>
调试时,总提示win2.document.open("text/plain")少对象,为什么?谢谢指教!
搜索更多相关主题的帖子: document javaScript length writeln 
2004-10-01 20:45
好学
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
帖 子:622
专家分:318
注 册:2004-5-4
收藏
得分:0 

[QUOTE]win2=open("","window2") [/QUOTE]

没有打开窗口的地址,第一个引号内不能为空。

text/plain是什么意思?你这段代码是想做什么用的

2004-10-01 21:40
daliboy
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2004-10-1
收藏
得分:0 

text/plain 我也不知道的,菜菜鸟而已,哈哈 这段代码的功能是在当前窗口的基础上创建一个新窗口,该新窗口统计原来窗口具有的一些属性而已。

2004-10-02 00:19
daliboy
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2004-10-1
收藏
得分:0 
搞定了,谢谢关注!!!
原来是浏览器的问题,我一直用tencent调试的,后来经朋友点拨,改用ie6.0就没问题了,真是虚惊一场。
2004-10-02 00:42
情圣
Rank: 1
等 级:新手上路
帖 子:63
专家分:0
注 册:2004-10-6
收藏
得分:0 

Script language="JavaScript">

注意喔

<Script language="JavaScript">

要养成良好的习惯啊...

高手往往都是忽略这些的,哈哈哈哈...

不是吗


在静中寻找一切最美的感觉... /images/upphoto/306.jpg" border="0" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://bbs.glite./images/upphoto/306.jpg');}" onmousewheel="return imgzoom(this);" alt="" />
2004-10-06 22:10
jacky
Rank: 1
等 级:新手上路
帖 子:104
专家分:0
注 册:2004-12-17
收藏
得分:0 

就该是这样吧

window.open("","","")

命令有三个参数,即使不赋值也要把它写上

2004-12-17 17:18
快速回复:【求助】大侠,帮我看看这段javaScript代码
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.012852 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved