| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1117 人关注过本帖
标题:结果出在哪儿求指点
只看楼主 加入收藏
诸葛修勤
Rank: 10Rank: 10Rank: 10
等 级:贵宾
威 望:11
帖 子:549
专家分:1955
注 册:2010-10-28
结帖率:96.55%
收藏
已结贴  问题点数:25 回复次数:13 
结果出在哪儿求指点
请谅解  程序肯定不是原创的!
程序代码:
<html>
    <head>
        <title>
            Using Properties
        </title>
        <script language="javascript">
            outputWindow = open("", "output")
            function setupWindow()
            {
                outputWindow.document.write("<html><head><title>Output Window</title></head><body>)
            }
       
            function describeNavigator()
            {
                outputWindow.document.write("<h2>Brower Properties</h2>")
                outputWindow.document.write(navigator.appCodeName+ " ")
                outputWindow.document.write(navigator.appName + " ")
                outputWindow.document.write(navigator.appVersion + "<br>")
                outputWindow.document.write(navigator.mimeTypes.length + " MIME types aer defined. ")
                outputWindow.document.write(navigator.plugins.length + " plug-ins are in-stalled.")
            }
            function describeWindow()
            {
                outputWindow.document.write("<h2>Window Properties</h2>")
                outputWindow.document.write("Frames: " + frames.length + "<br>")
                outputWindow.document.write("URL: " + location.href + "<br>")
            }
            function describeDocument()
            {
                outputWindow.document.write("<h2>Document Properties</h2>")
                describeLinks()
                describeForms()
            }
            function describeLinks()
            {
                outputWindow.document.write("<h3>Links</h3>")
                outputWindow.document.write("This document contains" + document.links.length + " links:<br>")
                for (i = 0; i < document.links.length; ++i)
                {
                    outputWindow.document.write(document.links[i].href + "<br>")
                }
            }
            function describeForms()
            {
                outputWindow.document.write("Form " + n + " has " + document.forms[n].elements.length + " elements:")
                for (j = 0; j < document.forms[n].elements.length; ++j)
                {
                    outputWindow.document.write(" " + document.forms[n].elements[j].name)
                }
                outputWindow.document.write("<br>")
            }
            function finishWindow()
            {
                outputWindow.document.write("<form><input type='button' value='Close Window' onclick='window.close()'></form>")
                outputWindow.document.write("</body></html>")
            }
        </script>
    </head>
    <body>
        <h1>Using Hierarchical Object Identifiers</h1>
        <p>
            <a href="http://www.baidu.com">Link to baidu.com.</a>
        </p>
        <p>
            <a href="https://bbs.bccn.net">Link to bccn.net</a>
        </p>
        <form>
            <p>
                <input type="text" name="textField1" value="Enter text here!">
            </p>
            <p>
                <input type="checkbox" name="checkbox1" checked="checked">I'm checkbox1.
            </p>
            <p>
                <input type="checkbox" name="checkbox2">I'm checkbox2
            </p>
            <input type="submit" name="submitButton" value="Click here!">
        </form>
        <script language="javascript">
            setupWindow()
            describeBrowser()
            describeWindow()
            describeDocument()
            finsihWindow()
        </script>
    </body>
</html>



搜索更多相关主题的帖子: title function javascript html 
2012-10-29 23:43
cnfarer
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:179
帖 子:3330
专家分:21157
注 册:2010-1-19
收藏
得分:25 
output窗口

★★★★★为人民服务★★★★★
2012-10-31 07:22
诸葛修勤
Rank: 10Rank: 10Rank: 10
等 级:贵宾
威 望:11
帖 子:549
专家分:1955
注 册:2010-10-28
收藏
得分:0 
回复 2楼 cnfarer
output窗口  是另外再开启的一个页面吧                     

如果是这样子的话     我运行了这个htm    然后没有后面的效果。
2012-10-31 08:36
诸葛修勤
Rank: 10Rank: 10Rank: 10
等 级:贵宾
威 望:11
帖 子:549
专家分:1955
注 册:2010-10-28
收藏
得分:0 
结帖吧,  买了本书回来学习《JavaScript权威指南》
2012-11-01 19:11
诸葛修勤
Rank: 10Rank: 10Rank: 10
等 级:贵宾
威 望:11
帖 子:549
专家分:1955
注 册:2010-10-28
收藏
得分:0 
请教各位  JavaScript   中的  API  怎么理解?
2012-11-06 08:51
诸葛修勤
Rank: 10Rank: 10Rank: 10
等 级:贵宾
威 望:11
帖 子:549
专家分:1955
注 册:2010-10-28
收藏
得分:0 
继续刊登问题
var a = [1, 2, 3];
delete a[2];//删除最后一个元素
2 in a;//=>false: 元素2在数组中已经不存在了
上面一段有点问题,   2 in  a;  这句中的2   按照意思应该是指下标值   但我感觉应该是指其中的数据值2的元素

2012-11-07 09:05
commonname
Rank: 1
等 级:新手上路
帖 子:5
专家分:5
注 册:2012-11-1
收藏
得分:0 
加油啊,好好学习吧www.

www.chinazhongqigroup
www.nbslyy
www.nbjcyy
2012-11-07 13:46
诸葛修勤
Rank: 10Rank: 10Rank: 10
等 级:贵宾
威 望:11
帖 子:549
专家分:1955
注 册:2010-10-28
收藏
得分:0 
回复 7楼 commonname
链接  广告?
2012-11-07 14:33
诸葛修勤
Rank: 10Rank: 10Rank: 10
等 级:贵宾
威 望:11
帖 子:549
专家分:1955
注 册:2010-10-28
收藏
得分:0 
回复 6楼 诸葛修勤
所有的索引都是属性名,但只有在0 ~ 2^32 - 2之间的整数属性名才是索引。


但是这里又有一个问题,  那属性的值到底是多少呢?
难道像这样的数组 var a = [1, 2, 3];  1是‘0’属性的值, 2是属性‘1’的值, 3是属性‘2’的值

2012-11-07 20:12
诸葛修勤
Rank: 10Rank: 10Rank: 10
等 级:贵宾
威 望:11
帖 子:549
专家分:1955
注 册:2010-10-28
收藏
得分:0 
继续刊登问题
程序代码:
///////////////code 1////////////////////
var a1 = [,,,];
var a2 = new Array(3);
0 in a1;//=>true:a1在索引0处有一个元素
0 in a2;//=>false:a2在索引0处没有元素
///////////////code 2////////////////////
var a1 = [,];
var a2 = [undefined];
0 in a1;//=>false:a1在索引0处没有元素
0 in a2;//=>true:a2在索引0处有一个值为undefined的元素

两处的0 in a1; 语句的结果怎么不同     分析应该都是true才对
2012-11-07 20:18
快速回复:结果出在哪儿求指点
数据加载中...
 
   



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

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