JavaScriptÊý×ÖÑéÖ¤
×¢Òâ:×îºÃ²»ÒªÊ¹ÓÃisNaN()·½·¨,ÒòΪÈç¹ûÒ»¸ö×Ö·ûÊǿոñµÄÇé¿öÏÂ,ËüÒ²»á°ÑËüµ±³ÉÊý×Ö.Äã±ØÐë´¦Àí¿Õ¸ñµÄÎÊÌâÁË.
ºÇºÇ,Æäʵ´¦Àí¿Õ¸ñµÄÎÊÌâÒ²²»ÄÑ,¸ü¼òµ¥µÄ·½·¨´¦ÀíÊý×ÖÎÊÌâÈçÏÂ:
-------------
function isNumber(str){
var mynumber="0123456789";
for(var i=0;i<str.length;i++){
var c=str.charAt(i);
if(mynumber.indexOf(c)==-1){
return false;
}
}
return true;
}
Ïà¹ØÎĵµ£º
CookiesÊÇÒ»ÖÖÄܹ»ÈÃÍøÕ¾·þÎñÆ÷°ÑÉÙÁ¿Êý¾Ý´¢´æµ½¿Í»§¶ËµÄÓ²ÅÌ»òÄڴ棬»òÊÇ´Ó¿Í»§¶ËµÄÓ²Å̶ÁÈ¡Êý¾ÝµÄÒ»ÖÖ¼¼Êõ¡£CookiesÊǵ±Äãä¯ÀÀÄ³ÍøÕ¾Ê±£¬ÓÉWeb·þÎñÆ÷ÖÃÓÚÄãÓ²ÅÌÉϵÄÒ»¸ö·Ç³£Ð¡µÄÎı¾Îļþ£¬Ëü¿ÉÒԼǼÄãµÄÓû§ID¡¢ÃÜÂë¡¢ä¯ÀÀ¹ýµÄÍøÒ³¡¢Í£ÁôµÄʱ¼äµÈÐÅÏ¢¡£µ±ÄãÔÙ´ÎÀ´µ½¸ÃÍøÕ¾Ê±£¬ÍøÕ¾Í¨¹ý¶ÁÈ¡Cookies£¬µÃÖªÄãµÄÏà¹ØÐÅÏ¢£¬¾Í ......
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>JavaScriptÄ£¿éË ......
/**
* ×Ô¼ºµÄ HashTable
* Ô¸½Å±¾ÉñÁ¦ÓëÄãͬÔÚ
*/
function HashTable(){
var values = {};
/** ½«Öµ²åÈë HashTable ÖÐ **/
this.put = function(key, value){
if(key in values){
return false;
}
values[key] = value;
}
/** ¸ù¾Ý key ·µ»Ø value **/
this.find = function(key){
ret ......
JavaScript×÷ÓÃС½á£º
1 ´´½¨½Å±¾¿é
1: <script language=”JavaScript”>
2: JavaScript code goes here
3: </script>
2 Òþ²Ø½Å±¾´úÂë
1: <script language=”JavaScript”>
2: <!--
3: document.write(“ ......
try { //Internet Explorer
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.loadXML(data);
} catch(e) { //Other Browsers
parser=new DOMParser();
xmlDoc=parser.parsefromString(data,"text/xml");
} ......