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

javascript DateÈÕÆÚ¶ÔÏó (ת)

´´½¨Ò»¸öÈÕÆÚ¶ÔÏó£º
var objDate=new Date([arguments list]);
²ÎÊýÐÎʽÓÐÒÔÏ£µÖÖ£º
   new Date("month dd,yyyy hh:mm:ss");
   new  Date("month dd,yyyy");
   new  Date(yyyy,mth,dd,hh,mm,ss);
   new Date(yyyy,mth,dd);
   new Date(ms);
ÐèҪעÒâ×îºóÒ»ÖÖÐÎʽ£¬²ÎÊý±íʾµÄÊÇÐèÒª´´½¨µÄʱ¼äºÍGMTʱ¼ä1970Äê1ÔÂ1ÈÕÖ®¼äÏà²îµÄºÁÃëÊý¡£¸÷ÖÖº¯ÊýµÄº¬ÒåÈçÏ£º
month:ÓÃÓ¢ÎıíʾÔ·ÝÃû³Æ£¬´ÓJanuaryµ½December
mth:ÓÃÕûÊý±íʾÔ·ݣ¬´Ó£¨£±Ô£©µ½£±£±£¨£±£²Ô£©
dd:±íʾһ¸öÔÂÖеĵڼ¸Ì죬´Ó1µ½31
yyyy:ËÄλÊý±íʾµÄÄê·Ý
hh:СʱÊý£¬´Ó0£¨ÎçÒ¹£©µ½23£¨Íí11µã£©
mm:·ÖÖÓÊý£¬´Ó0µ½59µÄÕûÊý
ss:ÃëÊý£¬´Ó0µ½59µÄÕûÊý
ms:ºÁÃëÊý£¬Îª´óÓÚµÈÓÚ0µÄÕûÊý
È磺
new Date("January 12,2006 22:19:35");
new Date("January 12,2006");
new Date(2006,0,12,22,19,35);
new Date(2006,0,12);
new Date(1137075575000);
ÉÏÃæµÄ¸÷ÖÖ´´½¨ÐÎʽ¶¼±íʾ2006¡¡Äê1ÔÂ12ÈÕÕâÒ»Ìì¡£
´Ó£Äate ¶ÔÏóÖÐÌáÈ¡ÐÅÏ¢
var objDate=new Date();
objDate.getFullYear()ÒÔËÄλÊý×Ö·µ»ØÄê
objDate.getYear()¸ù¾Ýä¯ÀÀÆ÷²»Í¬£¬ÒÔÁ½Î»»òÕßËÄλÊý×Ö·µ»ØÄê
objDate.getMonth()
objDate.getDate()
objDate.getDay()
objDate.getHours()
objDate.getMilliseconds().
   ..........
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head>
<body>
<script language="JavaScript" type="text/javascript">
<!--
var objDate=new Date();//´´½¨Ò»¸öÈÕÆÚ¶ÔÏó±íʾµ±Ç°Ê±¼ä
var year=objDate.getFullYear();
var month=objDate.getMonth()+1;    //getMonth·µ»ØµÄÔ·ÝÊÇ´Ó0¿ªÊ¼µÄ£¬Òò´ËÒª¼Ó1
var date=objDate.getDate();
var day=objDate.getDay();
//¸ù¾ÝÐÇÆÚÊýµÄË÷ÒýÈ·¶¨ÆäÖÐÎıíʾ
switch(day){
 &nb


Ïà¹ØÎĵµ£º

javascript ¸÷Öֵõ½ä¯ÀÀÆ÷¿í¶ÈºÍ¸ß¶ÈµÄº¯Êý

function getInfo()
{
    var s = "";
    s += " ÍøÒ³¿É¼ûÇøÓò¿í£º"+ document.body.clientWidth+"\n";
    s += " ÍøÒ³¿É¼ûÇøÓò¸ß£º"+ document.body.clientHeight+"\n";
    s += " ÍøÒ³¿É¼ ......

Javascript»ñÈ¡¸÷ÖÖä¯ÀÀÆ÷¿É¼û´°¿Ú´óС

¸ãÁË´ó°ëÌ죬×ÜËãŪÃ÷°×ÁËΪºÎÓÃdocument.body.clientHeight£¬document.body.offsetHeight¶¼Ã»Óаì
·¨»ñÈ¡ÍøÒ³¿É¼ûÇøÓòµÄÕýÈ·Öµ£¬Ô­À´×ï¿ý»öÊ×ÊÇW3C¶¨ÒåµÄ±ê×¼£¡£¡ÔÚж¨Òå³öÀ´µÄ±ê×¼ÏÂ
document.documentElement.clientHeightÔÚIEºÍ»ðºüÀﶼÄÜ»ñÈ¡ÕýÈ·Öµ£¬ÏÂÃæһƪÎÄÕÂÏêϸ½éÉÜÁË»ñÈ¡¸÷ÖÖä¯ÀÀÆ÷¿É¼û
´°¿Ú´óСÕâ·½ÃæµÄ²î ......

javascriptÖеÄmoveStartºÍmoveEnd·½·¨

Ïê̽TextRange¶ÔÏó--²éÕÒÓëÑ¡Ôñ
TextRange¶ÔÏóÊǶ¯Ì¬HTML(DHTML)µÄ¸ß¼¶ÌØÐÔ£¬Ê¹ÓÃËü¿ÉÒÔʵÏֺܶàºÍÎı¾ÓйصÄÈÎÎñ£¬ÀýÈçËÑË÷ºÍÑ¡ÔñÎı¾¡£Îı¾·¶Î§ÈÃÄú¿ÉÒÔÑ¡ÔñÐԵĽ«×Ö·û¡¢µ¥´ÊºÍ¾ä×Ó´ÓÎĵµÖÐÌôÑ¡³öÀ´¡£TextRange¶ÔÏóÊÇÔÚHTMLÎĵµ½«ÒªÏÔʾµÄÎı¾Á÷ÉϽ¨Á¢¿ªÊ¼ºÍ½áÊøλÖõijéÏó¶ÔÏó¡£
ÏÂÃæÊÇTextRangeµÄ³£ÓÃÊôÐÔÓë·½·¨£º
Ê ......

³£¼ûfirefox²»Ö§³ÖµÄJavaScriptÎÊÌâ

<a href="#" onclick="ChildNode(this);">aaa</a>Òª¸ÄΪ
<a href="#" onclick="ChildNode(event);">aaa</a>
ÎÞ·¨È¡µÃthis¶ÔÏó£¬ÒªÓÃÒÔÏ·½·¨À´È¡µÃ¡£
function ChildNode(e)
{
var evt = e ? e : (window.event ? window.event : null); //´Ë·½·¨ÎªÁËÔÚfirefoxÖеļæÈÝ
var node = evt.srcEl ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ