Alex刺客

          Dancing fingers, damage world. -- 舞動(dòng)手指,破壞世界.

            BlogJava :: 首頁(yè) :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
            57 隨筆 :: 0 文章 :: 76 評(píng)論 :: 0 Trackbacks

          #

          fedora12 少數(shù)文檔已經(jīng)出來(lái)中文,可以支官方下載資料
          http://docs.fedoraproject.org/

          注意以下命令全部都是在Root用戶下執(zhí)行,請(qǐng)你使用su命令切換至root用戶.
          [alex@localhost ~]$ su

          1.安裝第三方軟件包倉(cāng)庫(kù)
          [root@localhost alex]# rpm -ivh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm

          2.安裝自己挑選快速源鏡像
          [root@localhost alex]# yum install yum-fastestmirror

          3.安裝ibus五筆輸入法
          [root@localhost alex]# yum install ibus-table ibus-table-wubi

          4.安裝Adobe軟件包倉(cāng)庫(kù)
          [root@localhost alex]# rpm -ivh http://linuxdownload.adobe.com/adobe-release/adobe-release-i386-1.0-1.noarch.rpm

          5.安裝yum多線程下載工具Axel

          [root@localhost ~]# yum install axel

          配置 axelget yum 插件
          [root@localhost ~]# svn co http://cnfreesoft.googlecode.com/svn/trunk/axelget/ ~/axelget
          A??? /root/axelget/axelget.py
          A??? /root/axelget/axelget.conf
          取出版本 622。
          [root@localhost ~]# cd /etc/yum/pluginconf.d/
          [root@localhost pluginconf.d]# ln -s ~/axelget/axelget.conf
          [root@localhost pluginconf.d]# cd /usr/lib/yum-plugins/
          [root@localhost yum-plugins]# ln -s ~/axelget/axelget.py

          6.修改源配置文件

          修改/etc/yum.repos.d/*.repo文件,此步主要是為了獲取較快的站點(diǎn),如果你不修改,你的/var/cache/yum下每個(gè)文件夾的 mirrorlist.txt中就會(huì)有大量的的日本,臺(tái)灣的服務(wù)器站點(diǎn),這些站點(diǎn)速度非常慢
          ?????? 修改方法:
          [root@localhost /]# gedit /etc/yum.repos.d/*.repo
          ?????? 在每個(gè)文件的mirrorlist那行(一般是第5行,每個(gè)文件里有3處地方)的最后面加上“&country=us”.即選擇美國(guó)的服務(wù)器,因?yàn)槊绹?guó)的服務(wù)器最多,同時(shí)速度基本上是最快的(其他自己增加源的不須要更改。

          7.更新系統(tǒng)包包
          [root@localhost alex]# yum -y update
          posted @ 2010-03-18 00:12 Alex刺客 閱讀(742) | 評(píng)論 (0)編輯 收藏

               摘要: 剛學(xué)ExtJS 所完成的一個(gè)小項(xiàng)目

          所使用的技術(shù):javaEE Servlet + JSON + ExtJS

          開發(fā)平臺(tái) linux

          操作系統(tǒng): fedora 10 64位版
          JDK版本: sun 1.6.0_17 for linux 64
          IDE工具: eclipse-jee-galileo-SR1-linux-gtk-x86_64
          spket插件: spket-1.6.18
          ExtJS: ext-3.0.3
          Server: apache-tomcat-6.0.20
          MySQL: mysql-5.0.84 for linux 64
          FireFox: 3.0.14 for linux  閱讀全文
          posted @ 2009-12-24 21:46 Alex刺客 閱讀(1730) | 評(píng)論 (4)編輯 收藏

           1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
           2<html xmlns="http://www.w3.org/1999/xhtml">
           3    <head>
           4        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
           5        <title>原型鏈方式</title>
           6        <script type="text/javascript">
           7            /*
           8            *    項(xiàng)目: book -> Javascript高級(jí)程序設(shè)計(jì).pdf -> 第四章 -> 4.2.1 繼承的方式
           9            *    說(shuō)明:使用prototype屬性
          10            *    練習(xí)者: Alex刺客
          11            *    日期: 2009-12-13
          12            */

          13            
          14            /*
          15                原型鏈方式
          16                原型鏈的神奇之處在于突出顯示的代碼,這里把ClassB的prototype屬性設(shè)置成ClassA的實(shí)例。
          17                這很有意義,因?yàn)橄胍狢lassA的所有屬性和方法。所以把ClassB的全部屬性設(shè)置成ClassA的實(shí)例。
          18                因?yàn)檫@種繼承方式使用了prototype屬性,所以instanceof運(yùn)算符可以正確運(yùn)行。
          19            */

          20            function ClassA () {}
          21            
          22            ClassA.prototype.color = 'red';
          23            ClassA.prototype.sayColor = function () {
          24                alert(this.color);
          25            }

          26            
          27            function ClassB () {}
          28            ClassB.prototype = new ClassA();
          29            //添加新方法
          30            ClassB.prototype.name = "ClassB";
          31            ClassB.prototype.sayName = function () {
          32                alert(this.name);
          33            }

          34            
          35            /*
          36                混合方式 對(duì)象冒充+原型鏈
          37                跟建造類一樣的問(wèn)題也出現(xiàn)在繼承當(dāng)中,所以也就產(chǎn)生了這種方式。
          38                用對(duì)象冒充繼承構(gòu)造函數(shù),用原型鏈繼承prototype對(duì)象的方法。
          39            */

          40            
          41            function ClassD ( sColor) {
          42                this.color = sColor;
          43                if(typeof ClassD._initMethod == "undefined"{
          44                    ClassD.prototype.sayColor = function () {
          45                        alert(this.color);
          46                    }

          47                    alert('ClassD我只生成一次!');
          48                    ClassD._initMethod = true;
          49                }

          50            }

          51            var cd = new ClassD();
          52            function ClassE (sColor, sName) {
          53                ClassD.call(this,sColor);
          54                this.name = sName;
          55                if(typeof ClassE._initMethod == "undefined"{
          56                    ClassE.prototype.sayName =function () {
          57                        alert(this.name);
          58                    }

          59                    alert('ClassE我只生成一次!');
          60                    ClassE._initMethod = true;
          61                }

          62            }

          63            ClassE.prototype = new ClassD();
          64            /*
          65                繼承機(jī)制不能采用動(dòng)態(tài)化的原因是,prototype對(duì)象的唯一性。如果放入 if 區(qū)域 
          66                在代碼運(yùn)行前,對(duì)象已被實(shí)例化了,并與原始的prototype對(duì)象聯(lián)系在一起。雖然用極
          67                晚綁定可使對(duì)原型對(duì)象的修改正確地返映出來(lái),但是替換prototype對(duì)象卻不會(huì)對(duì)該對(duì)象
          68                產(chǎn)生任何影響。只有未來(lái)的對(duì)象實(shí)例才會(huì)反映出這種改變,這就使第一個(gè)實(shí)例變得不正確。
          69                
          70            */

          71            
          72            var ce1 = new ClassE("red","blueBoy");
          73            var ce2 = new ClassE("blue","redBoy");
          74            ce1.sayColor();
          75            ce1.sayName();
          76            ce2.sayColor();
          77            ce2.sayName();
          78            
          79            
          80        </script>
          81    </head>
          82    <body>
          83    </body>
          84</html>
          posted @ 2009-12-13 23:11 Alex刺客 閱讀(296) | 評(píng)論 (0)編輯 收藏

           1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
           2<html xmlns="http://www.w3.org/1999/xhtml">
           3    <head>
           4        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
           5        <title>對(duì)象冒充方式</title>
           6        <script type="text/javascript">
           7            /*
           8            *    項(xiàng)目: book -> Javascript高級(jí)程序設(shè)計(jì).pdf -> 第四章 -> 4.2.1 繼承的方式
           9            *    練習(xí)者: Alex刺客
          10            *    日期: 2009-12-13
          11            */

          12            
          13            /*
          14                1.對(duì)象冒充
          15            */

          16            //ClassA類
          17            function ClassA (sColor) {
          18                this.color = sColor;
          19                this.sayColor = function () {
          20                        alert(this.color);
          21                    }

          22            }

          23            
          24            //ClassB類
          25            function ClassB(sColor,sName){
          26                //當(dāng)前對(duì)象的屬性是ClassA函數(shù)的指針
          27                this.newMethod = ClassA;
          28                //把參數(shù)傳遞給它
          29                this.newMethod(sColor);
          30                //刪除當(dāng)前對(duì)象的ClassA函數(shù)的指針
          31                delete this.newMethod;
          32                
          33                //新增屬性和方法
          34                this.name = sName;
          35                this.sayName = function () {
          36                    alert(this.name);
          37                }

          38            }

          39            
          40            //var cb = new ClassB("blue!","Redboy");
          41            //cb.sayColor();
          42            //cb.sayName();
          43            
          44            /*
          45                call()方法
          46                call()方法與對(duì)象冒充方法最相似。它的第一個(gè)參數(shù)用作this的對(duì)象。
          47                其他參數(shù)都直接傳遞給函數(shù)自身。
          48            */

          49            //ClassC類
          50            function ClassC(sColor,sName){
          51                //this.newMethod = ClassA;
          52                //this.newMethod(sColor);
          53                //delete this.newMethod;
          54                ClassA.call(this,sColor); //以上三行代碼由這行替代
          55                
          56                //新增屬性和方法
          57                this.name = sName;
          58                this.sayName = function () {
          59                    alert(this.name);
          60                }

          61            }

          62            
          63            //var cc = new ClassC("blue","c");
          64            //cc.sayColor();
          65            //cc.sayName();
          66            
          67            /*
          68                apply()方法
          69                apply()方法有兩個(gè)參數(shù),跟call()方法相似,只是第二個(gè)參數(shù)變成了數(shù)組。
          70            */

          71            //ClassD類
          72            function ClassD(sColor,sName){
          73                //this.newMethod = ClassA;
          74                //this.newMethod(sColor);
          75                //delete this.newMethod;
          76                ClassA.apply(this,new Array(sColor)); //以上三行代碼由這行替代
          77                
          78                //新增屬性和方法
          79                this.name = sName;
          80                this.sayName = function () {
          81                    alert(this.name);
          82                }

          83            }

          84            
          85            //var dt = new ClassD("red","blueBoy");
          86            //dt.sayColor();
          87            //dt.sayName();
          88            
          89        </script>
          90    </head>
          91    <body>
          92    </body>
          93</html>
          posted @ 2009-12-13 23:10 Alex刺客 閱讀(258) | 評(píng)論 (0)編輯 收藏

           1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
           2<html xmlns="http://www.w3.org/1999/xhtml">
           3    <head>
           4        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
           5        <title>修改對(duì)象:創(chuàng)建新方法</title>
           6        <script type="text/javascript">
           7            /*
           8            *    項(xiàng)目: book -> Javascript高級(jí)程序設(shè)計(jì).pdf -> 第3章 -> 3.6 修改對(duì)象
           9            *
          10            *    說(shuō)明:每個(gè)構(gòu)造函數(shù)都有一個(gè)prototype屬性,可用于定義方法,而在ECMAScript中,每個(gè)本地對(duì)象也有一個(gè)用法完全相同的prototype屬性。
          11            *            
          12            *    練習(xí)者: Alex刺客
          13            *
          14            *    日期: 2009-12-13
          15            */

          16            
          17            /*
          18                可用prototype屬性為任何已有的類定義新方法,就像處理自己的類一樣。
          19                例如以下為Number類新增一個(gè)toHexString()方法。
          20            */

          21            Number.prototype.toHexString = function(){
          22                return this.toString(16);
          23            }

          24            
          25            var iNumber = 11;
          26            
          27            alert(iNumber.toHexString());
          28            
          29            /*
          30                Array類新增一個(gè)檢索匹配數(shù)組的值
          31            */

          32            
          33            Array.prototype.indexOf = function (vItem){
          34                for (var i=0; i<this.length; i++{
          35                    if(this[i] == vItem) {
          36                        return i;
          37                    }

          38                }

          39                return -1;
          40            }

          41            
          42            var aColors = new Array("red","green","yellow");
          43            alert(aColors.indexOf("green"));
          44        </script>
          45    </head>
          46    <body>
          47    </body>
          48</html>
          posted @ 2009-12-13 23:00 Alex刺客 閱讀(215) | 評(píng)論 (0)編輯 收藏

           1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
           2<html xmlns="http://www.w3.org/1999/xhtml">
           3    <head>
           4        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
           5        <title>實(shí)例</title>
           6        <script type="text/javascript">
           7            /*
           8            *    項(xiàng)目: book -> Javascript高級(jí)程序設(shè)計(jì).pdf -> 第3章 -> 3.5.8實(shí)例
           9            *
          10            *    說(shuō)明:自定義對(duì)象的使用
          11            *
          12            *    練習(xí)者: Alex刺客
          13            *
          14            *    日期: 2009-12-13
          15            */

          16
          17            /*
          18                定義一個(gè)一次合并當(dāng)前對(duì)象所有字符串的StringBuffer類
          19            */

          20            
          21            function StringBuffer () {
          22                this._strings_ = new Array;
          23                if (typeof StringBuffer._initialized == "undefined"{
          24                    StringBuffer.prototype.append = function (str){
          25                        this._strings_.push(str);
          26                    }

          27                    StringBuffer.prototype.toString = function(){
          28                        return this._strings_.join("");
          29                    }

          30                }

          31            }

          32            
          33            var stringBufferTest = new StringBuffer();
          34            var string2 = new StringBuffer();
          35            stringBufferTest.append("Hello ");
          36            stringBufferTest.append("World! ");
          37            stringBufferTest.append("Welcome");
          38            stringBufferTest.append("to ");
          39            stringBufferTest.append("JavaScript! ");
          40            string2.append("Alex ");
          41            string2.append("刺客!");
          42            var result = stringBufferTest.toString();
          43            var test = string2.toString();
          44            alert(result);
          45            alert(test);
          46        </script>
          47    </head>
          48    <body>
          49    </body>
          50</html>
          posted @ 2009-12-13 22:54 Alex刺客 閱讀(199) | 評(píng)論 (0)編輯 收藏

               摘要:   1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">   2<html&n...  閱讀全文
          posted @ 2009-12-13 22:52 Alex刺客 閱讀(223) | 評(píng)論 (0)編輯 收藏

           1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
           2<html xmlns="http://www.w3.org/1999/xhtml">
           3    <head>
           4        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
           5        <title>類型轉(zhuǎn)換</title>
           6        <script type="text/javascript">
           7            /*
           8            *    項(xiàng)目: book -> Javascript高級(jí)程序設(shè)計(jì).pdf -> 第2章 -> 2.6 原始類型
           9            *
          10            *    練習(xí)者: Alex刺客
          11            *
          12            *    日期: 2009-12-13
          13            */

          14            
          15            /*
          16                轉(zhuǎn)換成字符串
          17                ECMAScript 的 Boolean、Number、String這此原始類型有趣在于它們都是偽對(duì)象
          18                這意味著它們實(shí)際上具有屬性和方法。例如獲得字符串的長(zhǎng)度,可以用length屬性。
          19            */

          20            var sColor = "red";
          21            alert(sColor+"的長(zhǎng)度是:"+sColor.length);
          22            //outputs "3"
          23            
          24            /*
          25                3種主要的原始類型值Boolean、Nnmber、String 都有 toString()方法。不要感到奇怪
          26                String還有toString()方法。這是因?yàn)镋CMAScript定義所有對(duì)象都有toString()方法無(wú)論它
          27                是偽對(duì)象,還是真的對(duì)象。因?yàn)镾tring類型屬于偽對(duì)象,所以它一定有toString()方法。
          28            */

          29            var str = "Alex刺客";
          30            alert("String類型:'"+str+"'調(diào)用toString方法:雖然這是多余的:但我還是會(huì)給你:"+str.toString());
          31            
          32            /*
          33                Number類型的toString()方法分為默認(rèn)模式和基本模式。
          34                采用基本模式時(shí)在調(diào)用toString()方法時(shí)傳遞一個(gè)參數(shù)比如:2 代表 二進(jìn)制, 8 代表八進(jìn)制, 16代表十六進(jìn)制
          35            */

          36            
          37            var n8Number = 017;
          38            alert("八進(jìn)制Number類型轉(zhuǎn)換為String:"+n8Number.toString());
          39            //如果以上不調(diào)用toString()方法,也會(huì)執(zhí)行toString()方法
          40            alert("以二進(jìn)制轉(zhuǎn)換成String:"+n8Number.toString(2));
          41            
          42            /*
          43                轉(zhuǎn)換成數(shù)字
          44                ECMAScript提供兩種把非數(shù)字類型轉(zhuǎn)換成數(shù)字類型的方法,即parseInt()和parseFloat()。
          45                注意: 這兩個(gè)方法只轉(zhuǎn)換無(wú)效字符之前的字符串。 比如: "4.3zefef" 跟 '4.3.3' 結(jié)果都是  4.3
          46            */

          47                
          48                var iNumber = parseInt('1234');
          49                var fNumber = parseFloat('0.88');
          50                alert("字符串轉(zhuǎn)換成數(shù)字整型:"+iNumber);
          51                alert("字符串轉(zhuǎn)換成數(shù)字浮點(diǎn)型:"+fNumber);
          52                
          53                /*
          54                    parseInt()方法還有基本模式,可以把二進(jìn)制、八進(jìn)制、十六進(jìn)制或其他任何進(jìn)制的字符
          55                    轉(zhuǎn)換成整數(shù).是由parseInt()方法的第二個(gè)參數(shù)指定的。
          56                    parseFloat()方法不支技基本模式
          57                */

          58                
          59                //轉(zhuǎn)換為16進(jìn)制
          60                var i16 = parseInt("af"16);
          61                
          62                
          63                
          64                /*
          65                    強(qiáng)制類型轉(zhuǎn)換
          66                    Boolean(value) ——把給定的值轉(zhuǎn)換成Boolean型
          67                    Number(value)——把給定的值轉(zhuǎn)換成Number型
          68                    String(value)——把給定的值轉(zhuǎn)換成String型
          69                */

          70                
          71                var b1 = Boolean("");            //false
          72                var b2 = Boolean('hi');        //true
          73                var b3 = boolean(100);        //true
          74                var b4 = boolean(null);        //false
          75                var b5 = boolean(0);            //false
          76                var b6 = boolean(new Object());    //true
          77                
          78                
          79                /*
          80                    最后一種強(qiáng)制類型轉(zhuǎn)換方法String();可把任何值轉(zhuǎn)換成字符串。
          81                */

          82                
          83        </script>
          84    </head>
          85    <body>
          86    </body>
          87</html>
          posted @ 2009-12-13 22:50 Alex刺客 閱讀(425) | 評(píng)論 (0)編輯 收藏

           1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
           2<html xmlns="http://www.w3.org/1999/xhtml">
           3    <head>
           4        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
           5        <title>String類型</title>
           6        <script type="text/javascript">
           7            /*
           8            *    項(xiàng)目: book -> Javascript高級(jí)程序設(shè)計(jì).pdf -> 第2章 -> 2.6 原始類型
           9            *
          10            *    說(shuō)明:    String類型是沒有固定大小的原始類型。可以用雙引號(hào)( " )單引號(hào)( ' )聲明。
          11            *            String類型還包過(guò)幾種字符字面量,比如: \n 換行 \t 制表符
          12            *    練習(xí)者: Alex刺客
          13            *
          14            *    日期: 2009-12-13
          15            */

          16            var sColor1 = "blue";
          17            var SColor2 = 'blue';
          18        </script>
          19    </head>
          20    <body>
          21    </body>
          22</html>
          posted @ 2009-12-13 22:49 Alex刺客 閱讀(182) | 評(píng)論 (0)編輯 收藏

           1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
           2<html xmlns="http://www.w3.org/1999/xhtml">
           3    <head>
           4        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
           5        <title>Number類型</title>
           6        <script type="text/javascript">
           7            /*
           8            *    項(xiàng)目: book -> Javascript高級(jí)程序設(shè)計(jì).pdf -> 第2章 -> 2.6 原始類型
           9            *
          10            *    說(shuō)明:    Number類型可以表示32位的整數(shù),還可以表示64的浮點(diǎn)數(shù)。任何數(shù)字都被看作Number類型
          11            *            
          12            *    練習(xí)者: Alex刺客
          13            *
          14            *    日期: 2009-12-13
          15            */

          16            //整數(shù)
          17            var iNumber = 55;
          18            //八進(jìn)制。以0開頭
          19            var iNumber8 = 070;
          20            //十六進(jìn)制。以0x開頭
          21            var iNumber16 = 0xAf;
          22            
          23            /*
          24            注意:盡管Number類型可以表示為八進(jìn)制或十六進(jìn)制的字面量,
          25            但所有的數(shù)學(xué)運(yùn)算都是返回十進(jìn)制結(jié)果。
          26            */

          27            alert(iNumber8+iNumber16);
          28            //定義浮點(diǎn)值
          29            var fNumber = 5.0;
          30            //定義非常大的數(shù),可用科學(xué)記數(shù)法
          31            var fNumberMax = 3.889e7;
          32            /*
          33            也可用64位IEEE754形式存儲(chǔ)浮點(diǎn)值,這意味著十進(jìn)制最多可以有17個(gè)十
          34            進(jìn)制位。17位之后的值將被截去,從而造成一些小的數(shù)學(xué)誤差。
          35            
          36            幾個(gè)特殊值也被定義為Number 類型。前兩兩個(gè)是Number.MAX_VALUE
          37            和Number.MIN_VALUE.它們定義了Number值集合的外邊界。
          38            所有的ECMAScript數(shù)都必須在這兩個(gè)值之間。不過(guò)計(jì)算生成的數(shù)值結(jié)果可
          39            以不落在這兩個(gè)數(shù)之間。當(dāng)計(jì)算生成的數(shù)大于Number.MAX_VALUE時(shí),它
          40            將被賦予Number.POSITIVE_INFINITY,意味著不再有數(shù)字值。同樣,生成
          41            的數(shù)值小于Number.MIN_VALUE的計(jì)算也會(huì)被賦予值Number.NEGATIVE_INFINITY,
          42            也意味著不再有數(shù)字值。如果計(jì)算返回的是無(wú)窮大值,那么生成的結(jié)果不能再用于其它計(jì)算。
          43            */

          44            
          45            /*
          46                由于無(wú)窮大數(shù)可以是正數(shù)也可以是負(fù)數(shù),所以可用一個(gè)方法判斷一個(gè)數(shù)是否是有窮的。
          47                IsFinite(Number value)方法! value要判數(shù)的值
          48            */

          49            
          50            /*
          51                最后一個(gè)特殊值是NaN,表示非數(shù)(Not a Number)。NaN是個(gè)奇怪的特殊值。一般來(lái)說(shuō)
          52                這種情況發(fā)生在類型轉(zhuǎn)換失敗時(shí)。與無(wú)窮大值一樣,NaN也不能用于算術(shù)計(jì)算。NaN另一個(gè)
          53                奇怪之處在于,它與自身不相等!
          54            */

          55            
          56            alert( NaN == NaN);
          57            //false
          58            //出于這種原因,不推薦使用NaN值本身。函數(shù)isNaN()會(huì)做得相當(dāng)好。
          59            
          60            alert("字符串'blue'不能轉(zhuǎn)為數(shù)字類型"+isNaN("blue"));
          61            //true
          62            alert("字符串'123'不能轉(zhuǎn)為數(shù)字類型"+isNaN("123"));
          63            //false
          64        </script>
          65    </head>
          66    <body>
          67    </body>
          68</html>
          posted @ 2009-12-13 22:47 Alex刺客 閱讀(442) | 評(píng)論 (0)編輯 收藏

          僅列出標(biāo)題
          共6頁(yè): 上一頁(yè) 1 2 3 4 5 6 下一頁(yè) 
          主站蜘蛛池模板: 安仁县| 陇川县| 嘉义市| 苗栗市| 黔西县| 永定县| 化州市| 北票市| 游戏| 诏安县| 资源县| 沽源县| 吉水县| 北碚区| 祁连县| 苗栗县| 股票| 乌什县| 河曲县| 乐平市| 启东市| 伊川县| 台前县| 文登市| 内江市| 来宾市| 封开县| 通州市| 图木舒克市| 嘉兴市| 金门县| 民乐县| 丹棱县| 扎鲁特旗| 隆尧县| 衡山县| 澳门| 花莲市| 桐梓县| 大连市| 宁陵县|