JavaScriptÄÚÖöÔÏóÊôÐÔ¼°·½·¨´óÈ«
1.Date
ÊôÐÔ(1):
constructor Ëù½¨Á¢¶ÔÏóµÄº¯Êý²Î¿¼
prototype Äܹ»Îª¶ÔÏó¼ÓÈëµÄÊôÐԺͷ½·¨
·½·¨(43):
getDay() ·µ»ØÒ»ÖÜÖеĵڼ¸Ìì(0-6)
getYear() ·µ»ØÄê·Ý.2000ÄêÒÔǰΪ2λ,2000(°üº¬)ÒÔºóΪ4λ
getFullYear() ·µ»ØÍêÕûµÄ4λÄê·ÝÊý
getMonth() ·µ»ØÔ·ÝÊý(0-11)
getDate() ·µ»ØÈÕ(1-31)
getHours() ·µ»ØСʱÊý(0-23)
getMinutes() ·µ»Ø·ÖÖÓ(0-59)
getSeconds() ·µ»ØÃëÊý(0-59)
getMilliseconds() ·µ»ØºÁÃë(0-999)
getUTCDay() ÒÀ¾Ý¹ú¼Êʱ¼äÀ´µÃµ½ÏÖÔÚÊÇÐÇÆÚ¼¸(0-6)
getUTCFullYear() ÒÀ¾Ý¹ú¼Êʱ¼äÀ´µÃµ½ÍêÕûµÄÄê·Ý
getUTCMonth() ÒÀ¾Ý¹ú¼Êʱ¼äÀ´µÃµ½Ô·Ý(0-11)
getUTCDate() ÒÀ¾Ý¹ú¼Êʱ¼äÀ´µÃµ½ÈÕ(1-31)
getUTCHours() ÒÀ¾Ý¹ú¼Êʱ¼äÀ´µÃµ½Ð¡Ê±(0-23)
getUTCMinutes() ÒÀ¾Ý¹ú¼Êʱ¼äÀ´·µ»Ø·ÖÖÓ(0-59)
getUTCSeconds() ÒÀ¾Ý¹ú¼Êʱ¼äÀ´·µ»ØÃë(0-59)
getUTCMilliseconds()ÒÀ¾Ý¹ú¼Êʱ¼äÀ´·µ»ØºÁÃë(0-999)
getTime() ·µ»Ø´Ó1970Äê1ÔÂ1ºÅ0:0:0µ½ÏÖÔÚÒ»¹²»¨È¥µÄºÁÃëÊý
getTimezoneoffset() ·µ»ØʱÇøÆ«²îÖµ,¼´¸ñÁÖÍþÖÎƽ¾ùʱ¼ä(GMT)ÓëÔËÐнű¾µÄ¼ÆËã»úËù´¦Ê±ÇøÉèÖÃÖ®¼äÏà²îµÄ·ÖÖÓÊý)
parse(dateString) ·µ»ØÔÚDate×Ö·û´®ÖÐ×Ô´Ó1970Äê1ÔÂ1ÈÕ00:00:00ÒÔÀ´µÄºÁÃëÊý
setYear(yearInt) ÉèÖÃÄê·Ý.2λÊý»ò4λÊý
setFullYear(yearInt)ÉèÖÃÄê·Ý.4λÊý
setMonth(monthInt) ÉèÖÃÔ·Ý(0-11)
setDate(dateInt) ÉèÖÃÈÕ(1-31)
setHours(hourInt) ÉèÖÃСʱÊý(0-23)
setMinutes(minInt) ÉèÖ÷ÖÖÓÊý(0-59)
setSeconds(secInt) ÉèÖÃÃëÊý(0-59)
setMilliseconds(milliInt) ÉèÖúÁÃë(0-999)
setUTCFullYear(yearInt) ÒÀ¾Ý¹ú¼Êʱ¼äÀ´ÉèÖÃÄê·Ý
setUTCMonth(monthInt) ÒÀ¾Ý¹ú¼Êʱ¼äÀ´ÉèÖÃÔÂ(0-11)
setUTCDate(dateInt) ÒÀ¾Ý¹ú¼Êʱ¼äÀ´ÉèÖÃÈÕ(1-31)
setUTCHours(hourInt) ÒÀ¾Ý¹ú¼Êʱ
Ïà¹ØÎĵµ£º
JavaScript ×Ö·û´®×ª»»Êý×Ö(תÔØ)
·½·¨Ö÷ÒªÓÐÈýÖÖ
ת»»º¯Êý¡¢Ç¿ÖÆÀàÐÍת»»¡¢ÀûÓÃjs±äÁ¿ÈõÀàÐÍת»»¡£
1. ת»»º¯Êý
jsÌṩÁËparseInt()ºÍparseFloat()Á½¸öת»»º¯Êý¡£Ç°Õß°Ñֵת»»³ÉÕûÊý£¬ºóÕß°Ñֵת»»³É¸¡µãÊý¡£Ö»ÓжÔStringÀàÐ͵÷ÓÃÕâЩ·½·¨£¬ÕâÁ½¸öº¯Êý²ÅÄÜÕýÈ·ÔËÐУ»¶ÔÆäËûÀàÐÍ·µ»ØµÄ¶¼ÊÇNaN(Not a Number)¡£
ÔÚÅ ......
±Õ°ü£¨closure£©ÊÇJavascriptÓïÑÔµÄÒ»¸öÄѵ㣬ҲÊÇËüµÄÌØÉ«£¬ºÜ¶à¸ß¼¶Ó¦Óö¼ÒªÒÀ¿¿±Õ°üʵÏÖ¡£
ÏÂÃæ¾ÍÊÇÎÒµÄѧϰ±Ê¼Ç£¬¶ÔÓÚJavascript³õѧÕßÓ¦¸ÃÊǺÜÓÐÓõġ£
Ò»¡¢±äÁ¿µÄ×÷ÓÃÓò
ÒªÀí½â±Õ°ü£¬Ê×ÏȱØÐëÀí½âJavascriptÌØÊâµÄ±äÁ¿×÷ÓÃÓò¡£
±äÁ¿µÄ×÷ÓÃÓòÎ޷ǾÍÊÇÁ½ÖÖ£ºÈ«¾Ö±äÁ¿ºÍ¾Ö²¿±äÁ¿¡£
JavascriptÓïÑÔµÄÌØÊâÖ®´¦£¬¾ÍÔÚÓ ......
×î¶ÌµÄÍ϶¯´úÂë
<!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" />
<script l ......
var docEle = function() {
return document.getElementById(arguments[0]) || false;
}
function cloDiv(){
var overlayID="overlay";
var msgID = "overlayMsg";
document.body.removeChild(docEle(overlayID));
document.body.removeChild(docEle(msgID));
}
function openNewDiv() {
......
ÖÆ×÷ÍøÒ³µÄ¹ý³ÌÖУ¬ÄãÓÐʱºòÐèÒªÖªµÀij¸öÔªËØÔÚÍøÒ³ÉϵÄÈ·ÇÐλÖá£
ÏÂÃæµÄ½Ì³Ì×ܽáÁËJavascriptÔÚÍøÒ³¶¨Î»·½ÃæµÄÏà¹Ø֪ʶ¡£
Ò»¡¢ÍøÒ³µÄ¾ø¶Ô´óСºÍÏà¶Ô´óС
Ê×ÏÈ£¬ÒªÃ÷È·Á½¸ö»ù±¾¸ÅÄî¡£
Ò»ÕÅÍøÒ³µÄÈ«²¿Ãæ»ý£¬¾ÍÊÇËüµÄ¾ø¶Ô´óС¡£Í¨³£Çé¿öÏ£¬ÍøÒ³µÄ¾ø¶Ô´óСÓÉÄÚÈݺÍCSSÑùʽ±í¾ö¶¨¡£
ÍøÒ³µÄÏà¶Ô´óСÔòÊÇÖ¸ÔÚä¯ÀÀÆ÷´°¿ÚÖп ......