javascriptʵÏÖÕû¸öÒ³ÃæµÄ±³¾°ÑÕÉ«½¥±ä
Link:http://topic.csdn.net/u/20100317/15/687e21bc-40f3-4f0e-bc22-5f2a32ceb1a3.html?seed=1664090183&r=63989333#r_63989333
<HTML>
<head>
<title>sample</title>
<mce:script language="JavaScript"><!--
var c="FFFFFF";
window.onload=function (){
setInterval(setColor,100);
}
function setColor(){
document.body.style.background="#"+c;
c=parseInt("0x"+c);
if(c==0){
c="FFF";
}else{
c=(c-1).toString(16)
}
document.getElementById("txt1").value=c;
}
// --></mce:script>
</head>
<body>
<input type=text id=txt1>
</body>
</html>
Ïà¹ØÎĵµ£º
ÔÎÄÁ´½Ó£ºJavaScript: Its Not Just for Browsers Any More
Node.jsÊÇÒ»Ì×ÓÃÀ´±àд¸ßÐÔÄÜÍøÂç·þÎñÆ÷µÄJavaScript¹¤¾ß°ü£¬Ò»ÏµÁеı仯ÓÉ´Ë¿ªÊ¼¡£
Ò²ÐíÄ㻹²»ÖªµÀ£¬JavaScriptÏÖÔÚÒѾ³ÉÁËÒ»Ãſɱàд³öЧÂʼ«¸ßµÄ¡¢¿ÉÓÃÓÚ¿ª·¢²úÆ·¼¶web·þÎñÆ÷µÄ³öÉ«ÓïÑÔ¡£Æð³õÎÒÒ²²»ÏàÐÅ£¬µ«2009 ÄêÆô¶¯µÄÁ½¸öÏîÄ¿ÈÃÕâ³ÉΪ¿ÉÄÜ£ºCommonJSº ......
¸öÈËÈÏΪ×îºÃµÄ·½·¨²ÉÓõÄÊÇÕýÔò±í´ïʽ,ÕâÊÇ×îºËÐĵÄÔÀí.
Æä´Î.Õâ¸ö·½·¨Ê¹ÓÃÁËJavaScript µÄprototype ÊôÐÔ
ÆäʵÄ㲻ʹÓÃÕâ¸öÊôÐÔÒ»Ñù¿ÉÒÔÓú¯ÊýʵÏÖ.µ«ÕâÑù×öºóÓÃÆðÀ´±È½Ï·½±ã.
ÏÂÃæ¾ÍÀ´¿´¿´Õâ¸öÊôÐÔÊÇÔõôÀ´ÓõÄ.
·µ»Ø¶ÔÏóÀàÐÍÔÐ͵ÄÒýÓá£
objectName.prototype
objectName ²ÎÊýÊǶÔÏóµÄÃû³Æ¡£
˵Ã÷
ÓÃ ......
À´Ô´£ºhttp://blog.csdn.net/yjq8116/archive/2008/11/04/3219993.aspx
·½·¨Ö÷ÒªÓÐÈýÖÖ
ת»»º¯Êý¡¢Ç¿ÖÆÀàÐÍת»»¡¢ÀûÓÃjs±äÁ¿ÈõÀàÐÍת»»¡£
1. ת»»º¯Êý
jsÌṩÁËparseInt()ºÍparseFloat()Á½¸öת»»º¯Êý¡£Ç°Õß°Ñֵת»»³ÉÕûÊý£¬ºóÕß°Ñֵת»»³É¸¡µãÊý¡£Ö»ÓжÔStringÀàÐ͵÷ÓÃÕâЩ·½·¨£¬ÕâÁ½¸öº¯Êý²ÅÄÜÕýÈ·ÔËÐУ»¶ÔÆäËûÀàÐÍ·µ» ......
<mce:script type="text/javascript"><!--
function SetCookie(name,value,expire) {
var exp = new Date();
exp.setTime(exp.getTime() + expire);
document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
} ......