JavaScript¶ÁÈ¡TxtÎļþ
JavaScript¶ÁÈ¡TxtÎļþ
<html>
<head>
<title>new page</title>
<script>
GetHeader(src) {
var ForReading=1;
var fso=new ActiveXObject("Scripting.FileSystemObject");
var f=fso.OpenTextFile(src,ForReading);
return(f.ReadAll());
}
var arr=GetHeader("C:\\a.txt").split("\r\n");
for(var i=0;i<arr.length;i++){
alert("µÚ"+(i+1)+"ÐÐÊý¾ÝΪ:"+arr[i]);
}
</script>
</head>
<body>
</body>
</html>
Ïà¹ØÎĵµ£º
¾²Ì¬·½·¨µÄʵÖÊÓëÈÎºÎÆäËûÒ»°ãº¯ÊýûÓÐʲô²»Í¬£¬×îÖ÷ÒªµÄÇø±ðÔÚÓÚ£¬ÆäËûº¯ÊýÊÇÒÔ¶ÔÏóµÄ¾²Ì¬ÊôÐÔÐÎʽ´æÔڵġ£×÷Ϊһ¸öÊôÐÔ£¬ËüÃDz»ÄÜÔڸöÔÏóµÄʵÀýµÄÉÏÏÂÎÄÖзÃÎÊ£¬¶øÖ»ÊôÓÚÖ÷¶ÔÏó±¾ÉíµÄÄǸöÉÏÏÂÎÄÖС£¶Ôϰ¹ßÁË´«Í³Ààʽ¼¯³ÉµÄÈËÀ´Ëµ£¬Õâ¾ÍÏñÀàÀﶨÒåµÄ¾²Ì¬·½·¨¡£
  ......
1.Dean Edwards±àдµÄPacker£¨http://dean.edwards.name/packer/£©£¬ÓÃÓÚѹËõJavaScript
2.»ñÈ¡JQuery£ºhttp:/jquery.com
http://docs.jquery.com/Downloading_jQuery ÏÂÔØ¸÷¸ö°æ±¾¼°ÏàÓ¦°ïÖúÎ ......
JavaScriptÒÔECMAScript±ê×¼×÷Ϊ¹¦ÄÜ»ù×¼£¬ECMAScriptÓÐ5ÖÖÔÐÍÀàÐÍ£ºUndefined£¬Null£¬Boolean£¬NumberºÍString¡£
¿ÉÒÔÓÃtypeofÀ´ÅжÏÀàÐÍ£¬Àý£º
var sTemp = "test string";
alert(typeof sTem ......
ÓÃÓÚö¾Ù¶ÔÏóµÄÊôÐÔ
Àý£º
for(sProp in window)
{
alert(sProp); //ÏÔʾBOM window¶ÔÏóµÄËùÓÐÊôÐÔ¡£
}& ......
deleteÖ»ÄÜɾ³ý¿ª·¢Õß¶¨ÒåµÄÊôÐÔ»ò·½·¨£¬ÔʼµÄECMAScript·½·¨²»ÄÜɾ³ý£¬ÒòΪ²»ÊÇ¿ª·¢Õß¶¨ÒåµÄ£¬±ÈÈ磺toString()¡£
var o = new Object;
o.name = "Nicholas";
delete o.name;
&n ......