Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

JavaScript ×Ö·û´®×ª»»Êý×Ö

À´Ô´£ºhttp://blog.csdn.net/yjq8116/archive/2008/11/04/3219993.aspx
·½·¨Ö÷ÒªÓÐÈýÖÖ
ת»»º¯Êý¡¢Ç¿ÖÆÀàÐÍת»»¡¢ÀûÓÃjs±äÁ¿ÈõÀàÐÍת»»¡£
1. ת»»º¯Êý
jsÌṩÁËparseInt()ºÍparseFloat()Á½¸öת»»º¯Êý¡£Ç°Õß°Ñֵת»»³ÉÕûÊý£¬ºóÕß°Ñֵת»»³É¸¡µãÊý¡£Ö»ÓжÔStringÀàÐ͵÷ÓÃÕâЩ·½·¨£¬ÕâÁ½¸öº¯Êý²ÅÄÜÕýÈ·ÔËÐУ»¶ÔÆäËûÀàÐÍ·µ»ØµÄ¶¼ÊÇNaN(Not a Number)¡£
ÔÚÅжÏ×Ö·û´®ÊÇ·ñÊÇÊý×Öֵǰ£¬parseInt()ºÍparseFloat()¶¼»á×Ðϸ·ÖÎö¸Ã×Ö·û´®¡£parseInt()·½·¨Ê×ÏȲ鿴λÖÃ0´¦µÄ×Ö·û£¬ÅжÏËüÊÇ·ñÊǸöÓÐЧÊý×Ö£»Èç¹û²»ÊÇ£¬¸Ã·½·¨½«·µ»ØNaN£¬²»ÔÙ¼ÌÐøÖ´ÐÐÆäËû²Ù×÷¡£µ«Èç¹û¸Ã×Ö·ûÊÇÓÐЧÊý×Ö£¬¸Ã·½·¨½«²é¿´Î»ÖÃ1´¦µÄ×Ö·û£¬½øÐÐͬÑùµÄ²âÊÔ¡£ÕâÒ»¹ý³Ì½«³ÖÐøµ½·¢ÏÖ·ÇÓÐЧÊý×ÖµÄ×Ö·ûΪֹ£¬´ËʱparseInt()½«°Ñ¸Ã×Ö·û֮ǰµÄ×Ö·û´®×ª»»³ÉÊý×Ö¡£
ÀýÈ磬Èç¹ûÒª°Ñ×Ö·û´® "1234blue "ת»»³ÉÕûÊý£¬ÄÇôparseInt()½«·µ»Ø1234£¬ÒòΪµ±Ëü¼ì²âµ½×Ö·ûbʱ£¬¾Í»áÍ£Ö¹¼ì²â¹ý³Ì¡£×Ö·û´®Öаüº¬µÄÊý×Ö×ÖÃæÁ¿»á±»Õýȷת»»ÎªÊý×Ö£¬Òò´Ë×Ö·û´® "0xA "»á±»Õýȷת»»ÎªÊý×Ö10¡£²»¹ý£¬×Ö·û´® "22.5 "½«±»×ª»»³É22£¬ÒòΪ¶ÔÓÚÕûÊýÀ´Ëµ£¬Ð¡ÊýµãÊÇÎÞЧ×Ö·û¡£Ò»Ð©Ê¾ÀýÈçÏ£º
parseInt("1234blue");   //returns   1234
parseInt("0xA");   //returns   10
parseInt("22.5");   //returns   22
parseInt("blue");   //returns   NaN
parseInt()·½·¨»¹Óлùģʽ£¬¿ÉÒ԰Ѷþ½øÖÆ¡¢°Ë½øÖÆ¡¢Ê®Áù½øÖÆ»òÆäËûÈκνøÖƵÄ×Ö·û´®×ª»»³ÉÕûÊý¡£»ùÊÇÓÉparseInt()·½·¨µÄµÚ¶þ¸ö²ÎÊýÖ¸¶¨µÄ£¬ËùÒÔÒª½âÎöÊ®Áù½øÖƵÄÖµ£¬ÐèÈçϵ÷ÓÃparseInt()·½·¨£º
parseInt("AF",   16);   //returns   175
µ±È»£¬¶Ô¶þ½øÖÆ¡¢°Ë½øÖÆ£¬ÉõÖÁÊ®½øÖÆ£¨Ä¬ÈÏģʽ£©£¬¶¼¿ÉÒÔÕâÑùµ÷ÓÃparseInt()·½·¨£º
parseInt("10",   2);   //returns   2
parseInt("10",   8);   //returns   8
parseInt("10",   10);   //returns   10
Èç¹ûÊ®½øÖÆÊý°üº¬Ç°µ¼0£¬ÄÇô×îºÃ²ÉÓûùÊý10£¬ÕâÑù²Å²»»áÒâÍâµØµÃµ½°Ë½øÖƵÄÖµ¡£ÀýÈ磺
parseInt("010");   //returns   8
parseInt(&qu


Ïà¹ØÎĵµ£º

JavaScript¾«´â¶ÁÊé±Ê¼Ç(3)

http://blog.csdn.net/mouyong/archive/2009/11/21/4847303.aspx
µÚ3Õ  ¶ÔÏó
JavaScriptµÄ¼òµ¥ÀàÐÍ°üÀ¨Êý×Ö¡¢×Ö·û´®¡¢²¼¶ûÖµ£¨trueºÍfalse£©¡¢nullÖµºÍundefinedÖµ¡£ÆäËûËùÓеÄÖµ¶¼ÊǶÔÏó¡£Êý×Ö¡¢×Ö·û´®ºÍ²¼¶ûÖµ“òËÆ”¶ÔÏó£¬ÒòΪËüÃÇÓµÓз½·¨£¬µ«ËüÃÇÊDz»¿É±äµÄ¡£JavaScriptÖеĶÔÏóÊǿɱäµÄ¼ü-Öµ ......

JavaScript¾«´â¶ÁÊé±Ê¼Ç(5)

http://blog.csdn.net/mouyong/archive/2010/01/10/5169396.aspx
µÚ5Õ  ¼Ì³Ð
ÔÚÄÇЩ»ùÓÚÀàµÄÓïÑÔ£¨±ÈÈçJava£©ÖУ¬¼Ì³Ð£¨inheritance»òextends£©ÌṩÁËÁ½¸öÓÐÓõķþÎñ¡£Ê×ÏÈ£¬ËüÊÇ´úÂëÖØÓõÄÒ»ÖÖÐÎʽ¡£Èç¹ûÒ»¸öеÄÀàÓëÒ»¸öÒÑ´æÔÚµÄÀà´ó²¿·ÖÏàËÆ£¬ÄÇôÄãÖ»Ðë¾ßÌå˵Ã÷Æ䲻ͬµã¼´¿É¡£Àà¼Ì³ÐµÄÁíÒ»¸öºÃ´¦ÊÇËü°üÀ¨Á ......

µ÷Óù¤×÷Á÷(Javascript)

function testExe(entityId, wfId) {
var id = crmForm.ObjectId;
var xml = "" +
"<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
"<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http:/ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ