ÓÃJavaScript·â×°ÏÂFileSystemObject£¬×öÏÂÎļþ²Ù×÷£¡
/*
* To change this template, choose Tools | Templates
* and open the template in the editor
*/
var File = {
name:'',
path:'',
ext:'',
cfiles:[],
attributes:{
driver:'',
parentFolder:'',
shortName:'',
shortPath:'',
type:''
},
getInstance:function(){
var reObj = {};
this.path = arguments[0];
this.name = arguments[1];
Object.extend(reObj, this);
//³õʼ»¯FSO¶ÔÏó
try{
this.fso = new ActiveXObject("Scripting.FileSystemObject");
if(!(fso.FolderExists(this.path))){
fso.CreateFolder(this.path);
};
}catch(e){
alert(e.message);
return;
};
//Èç¹ûÊÇÎļþ¼Ð£¬»ñµÃ¸ÃÎļþ¼ÐÏÂËùÓÐÎļþ
if("" == this.name){
this.attributes.type = 'FOLDER';
var folder = fso.GetFolder(this.path);
this.cfiles = new Enumerator(folder.Files);
}else{
Ïà¹ØÎĵµ£º
·µ»Ø JavaScript È«¾Ö¶ÔÏó²Î¿¼ÊÖ²á
¶¨ÒåºÍÓ÷¨
isNaN() º¯ÊýÓÃÓÚ¼ì²éÆä²ÎÊýÊÇ·ñÊÇ·ÇÊý×ÖÖµ¡£
Óï·¨
isNaN(x)
²ÎÊýÃèÊö
x
±ØÐè¡£Òª¼ì²âµÄÖµ¡£
·µ»ØÖµ
Èç¹û x ÊÇÌØÊâµÄ·ÇÊý×ÖÖµ NaN£¨»òÕßÄܱ»×ª»»ÎªÕâÑùµÄÖµ£©£¬·µ»ØµÄÖµ¾ÍÊÇ true¡£Èç¹û x ÊÇÆäËûÖµ,Ôò·µ»Ø false¡£
˵Ã÷
isNaN() º¯Êý¿ÉÓÃÓÚÅÐ¶ÏÆä²ÎÊýÊÇ·ñÊÇ NaN£ ......
Ò»¡¢ÀàÐÍת»»µÄ·½·¨ºÍÓ¦¸Ã×¢ÒâµÄÎÊÌ⣺
1£¬×ª»»Îª²¼¶ûÐÍ£º
£¨1£©ÓÃÁ½´Î·ÇÔËËã(!):
!!5 ==> true
£¨2£©Óò¼¶ûÐ͵Ĺ¹Ô캯Êý£º
new Boolean(5) == > true
ֵת»»Îª²¼¶ûÀàÐÍΪfalse£º
0£¬+0£¬-0£¬NaN£¬""(¿Õ×Ö·û´®),undefined,null
³ýÉÏÃæµÄÖµÆäËûÖµÔÚת»»ÒÔºóΪtrue£¬ÐèÒªÌØ±ðÌáµ½µÄÊÇ:
"0",new Object(),funct ......
javascript ÀඨÒå4ÖÖ·½·¨
Java´úÂë
/*
¹¤³§·½Ê½--- ´´½¨²¢·µ»ØÌض¨ÀàÐ͵ĶÔÏóµÄ ¹¤³§º¯Êý £¨ factory function £©
*/
function createCar(color,doors,mpg){
......
¶ÁÈ¡XMLÎĵµ£»
²ÉÓõݹéÉú³ÉÎÞÏÞ¼¶µÄÊ÷Ðβ˵¥£»
Äܹ»ÏìÓ¦Êó±êʼþ£¬Õ¹¿ªÓë²ðµþ×Ó¼¶²Ëµ¥£»
Ê×ÏÈÊÇÉú³ÉÒ»¸öXMLÎĵµ£¬ÎÒÓõÄÊÇXML SpyµÄ±à¼Æ÷£»
<?xml version="1.0" encoding="utf-8"?>
<menu>
<menu name="Ã÷ ......