[JavaScript]ÀàÖ®¶þ
javascript ÀඨÒå4ÖÖ·½·¨
Java´úÂë
/*
¹¤³§·½Ê½--- ´´½¨²¢·µ»ØÌض¨ÀàÐ͵ĶÔÏóµÄ ¹¤³§º¯Êý £¨ factory function £©
*/
function createCar(color,doors,mpg){
var tempCar = new Object;
tempCar.color = color;
tempCar.doors = doors;
tempCar.mpg = mpg;
tempCar.showCar = function(){
alert(this.color + " " + this.doors);
}
return tempCar;
}
/*
¹¹Ô캯Êý·½Ê½--- ¹¹Ô캯Êý¿´ÆðÀ´ºÜÏñ¹¤³§º¯Êý
*/
function Car(color,doors,mpg){
this.color = color;
this.doors = doors;
this.mpg = mpg;
this.showCar = function(){
alert(this.color);
};
}
/*
ÔÐÍ·½Ê½--- ÀûÓÃÁ˶ÔÏóµÄ prototype ÊôÐÔ£¬¿É°ÑËü¿´³É´´½¨Ð¶ÔÏóËùÒÀÀµµÄÔÐÍ
*/
function Car(color,doors,mpg){
this.color = color;
this.doors = doors;
this.mpg = mpg;
this.drivers = new Array("nomad","angel");
} &nb
Ïà¹ØÎĵµ£º
javascriptµ÷Óø¸´°¿ÚµÄº¯ÊýºÍ±äÁ¿
·¢²¼ÈÕÆÚ£º2008-05-28×î½ü¸üУº2008-05-28À´Ô´£ºBHCODE×÷Õߣº
web¿ª·¢µÄʱºò£¬ÓÐʱºòÐèҪʹÓÃÆäËûÒ³ÃæÉÏдºÃµÄjavasriptº¯Êý¡¢±äÁ¿¡£È絯³ö´°¿ÚÐèҪʹÓø¸´°¿ÚÖеĺ¯Êý£¬¿ò¼Ü1ÐèҪʹÓÿò¼Ü2Öеĺ¯Êý¡£
µ÷Óú¯Êý¡¢±äÁ¿µÄ·½·¨Ò»Ñù£¬¶¼ÊÇÐèÒªÊ×ÏÈ»ñµÃÄãÐèÒªµ÷Óõĺ¯ÊýËùÔÚµÄwindow¶ÔÏó ......
Ô´´úÂëÈçÏ£º
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>ÑéÖ¤ÓÊÏäµØÖ·ºÏ·¨ÐÔ</title>
<sc ......
·µ»Ø JavaScript È«¾Ö¶ÔÏó²Î¿¼ÊÖ²á
¶¨ÒåºÍÓ÷¨
isNaN() º¯ÊýÓÃÓÚ¼ì²éÆä²ÎÊýÊÇ·ñÊÇ·ÇÊý×ÖÖµ¡£
Óï·¨
isNaN(x)
²ÎÊýÃèÊö
x
±ØÐè¡£Òª¼ì²âµÄÖµ¡£
·µ»ØÖµ
Èç¹û x ÊÇÌØÊâµÄ·ÇÊý×ÖÖµ NaN£¨»òÕßÄܱ»×ª»»ÎªÕâÑùµÄÖµ£©£¬·µ»ØµÄÖµ¾ÍÊÇ true¡£Èç¹û x ÊÇÆäËûÖµ,Ôò·µ»Ø false¡£
˵Ã÷
isNaN() º¯Êý¿ÉÓÃÓÚÅжÏÆä²ÎÊýÊÇ·ñÊÇ NaN£ ......
ʵÀýЧ¹û
Ô¤ÀÀЧ¹û1£º
ÕâÊÇÒ»¸öÑÕÉ«Ìݶȱ仯ÑÝʾ£º
Ô¤ÀÀЧ¹û2£º
Ò»¸öÑÕÉ«½¥±äµÄ²Ëµ¥£º
Cropper
Tween
Slider
Resize
Drag
Ô¤ÀÀЧ¹û3£º
ÑÕÉ«½¥±äµÄÓÐȤӦÓ㬵ã»÷Ëæ»úÑÕÉ«½¥±ä£º
µã»÷Ëæ»ú»»ÑÕÉ«
³ÌÐò˵Ã÷
¡¾ColorGradsÑÕÉ«Ìݶȡ¿
³ÌÐòColorGradsµÄ×÷ÓÃÊÇͨ¹ýStartColorºÍEndColorÉú³ÉÑÕÉ«Ìݶȼ¯ºÏ¡£
ÑÕÉ«¶¼¿ ......
Ò»¸ö¼òµ¥µÄjavascriptÀඨÒåÀý×Ó
º¸ÇÁËjavascript¹«ÓгÉÔ±¶¨Ò塢˽ÓгÉÔ±¶¨Òå¡¢ÌØȨ·½·¨¶¨ÒåµÄ¼òµ¥Ê¾Àý
Java´úÂë
<script>
//¶¨ÒåÒ»¸öjavascriptÀà
function JsClass(privateParam/*&n ......