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

javascript

 µÚÒ»Ìâ
±àдһ¸ö·½·¨ ÇóÒ»¸ö×Ö·û´®µÄ×Ö½Ú³¤¶È
µÚ¶þÌâ
ÈçºÎ¿ØÖÆalertÖеĻ»ÐÐ
µÚÈýÌâ
½âÊÍdocument.getElementById("ElementID").style.fontSize="1.5em"
µÚËÄÌâ
½«Ò»¸öÀàËÆͼÖеÄЧ¹û·ÖÀë³ÉcssºÍhtml
µÚÎåÌâ
°´ÕÕ¸ñʽ xxxxÄêxxÔÂxxÈÕxxʱxx·ÖxxÃ붯̬ÏÔʾʱ¼ä ÒªÇó²»×ã10µÄ²¹0
µÚÁùÌâ
±àдһ¸ö·½·¨ È¥µôÒ»¸öÊý×éµÄÖظ´ÔªËØ
µÚÆßÌâ
˵³ö3ÌõÒÔÉÏffºÍieµÄ½Å±¾¼æÈÝÎÊÌâ
µÚ°ËÌâ
°´ÒªÇóдһ¸ö¼òµ¥µÄajaxʾÀý ¼òµ¥µÄûÒâÒå ¾Í²»Ð´ÁË
תÌùÇë×¢Ã÷ : http://www.pghome.net Ö¾Ô¶¹¤×÷ÊÒ
1.
<script language="javascript" type="text/javascript">
new function(s)
{
if(!arguments.length||!s) return null;
if(""==s) return 0;
var l=0;
for(var i=0;i<s.length;i++)
{
if(s.charCodeAt(i)>255) l+=2;
else l++;
}
alert(l);
}("helloÄãºÃ£¬ÎÒºÃ,´ó¼ÒºÃ£¡world!");
</script>
2.
<script language="javascript" type="text/javascript">
alert("hello\nworld");
</script>
3.
emÊǸöÏà¶Ôµ¥Î»¡£
5.
<script language="javascript" type="text/javascript">
new function()
{
with(new Date())
{
var t=function(a){return a<10?"0"+a:a;}
alert(getFullYear()+"Äê"+t(getMonth()+1)+"ÔÂ"+t(getDate())+"ÈÕ"+t(getHours())+"ʱ"+t(getMinutes())+"·Ö"+t(getSeconds())+"Ãë");
}
}
</script>
6.
תÌùÇë×¢Ã÷ : http://www.pghome.net Ö¾Ô¶¹¤×÷ÊÒ
<script language="javascript" type="text/javascript">
Array.prototype.strip=function()
{
if(this.length<2) return [this[0]]||[];
var arr=[];
for(var i=0;i<this.length;i++)
{
arr.push(this.splice(i--,1));
for(var j=0;j<this.length;j++)
{
if(this[j]==arr[arr.length-1])
{
this.splice(j--,1);
}
}
}
return arr;
}
var arr=["abc",85,"abc",85,8,8,1,2,5,4,7,8];
alert(arr.strip());
</script>
8.
<html>
<head><title>loading</title></head>
<body>
<div id="load">Êý¾ÝÕýÔÚ¼ÓÔØ......</div>
<script type="text/javascript">
var Browser={
/**
Browser¶ÔÏóÓÃÓÚ¼ì²âä¯ÀÀÆ÷£¬ÆäÖÐÓõ½ÁËIEµÄÌõ¼þ±àÒë
*/
/*@cc_on
isIE:true,
@*/
isFF:window.navigator.appName.toUpperC


Ïà¹ØÎĵµ£º

javascript²Ù×÷cookie

 //set cookie

function setcookie(name,value){
var Days = 30;
var exp = new Date();
exp.setTime(exp.getTime() + Days*24*60*60*1000);
document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
}

function getcookie(name) ......

10 ¸öÖøÃûµÄ JavaScript ¿â¡¾×ª¡¿

 JavaScript ÊÇ Web ¿ª·¢ÓëÉè¼ÆÖв»¿É»òȱµÄ¶«Î÷£¬²»¹ÜÊÇÒ»¸ö¼òµ¥µÄÍøÒ³»¹ÊÇÒ»¸öרҵµÄÕ¾µã£¬Ò²²»¹ÜÄãÊǸßÊÖ»¹ÊDzËÄñ£¬Èç½ñ JavaScript
¿âÔ½À´Ô½Ç¿´ó£¬¿ÉÒÔʤÈÎÐí¶à¸´ÔӵŤ×÷£¬È»¶øͬʱ£¬ÈËÃÇÔÚÖÚ¶à JavaScript ¿âÃæÇ°ÓÖ¾õµÃÎÞËùÊÊ´Ó£¬±¾ÎÄ£¬ÎÒÃǽ«Ê¹Óà Google ËÑË÷³öÅÅÃûÇ° 10 λµÄ
JavaScript ¿â£¬²¢¶ÔËüÃÇÖðÒ» ......

JavaScript¼ò½é

JavaScript         ECMAScriptÊÇÕâ¸ö½Å±¾ÓïÑԵıê×¼»¯°æ±¾¡£ ScriptÔªËØ£º             ÔÚHTML´úÂëÖÐÌí¼ÓJavaScript´úÂë             Ò²¿ÉÒ԰ѽű¾´úÂë·ÅÔ ......

ʲôÊÇJavaScript£¿

JavaScriptÊÇÓÉNetscape¿ª·¢µÄ¹ã·ºÓÃÓÚÊý°ÙÍòÍøÒ³ºÍ·þÎñÆ÷Ó¦ÓóÌÐòµÄ¶ÔÏó½Å±¾ÓïÑÔ¡£NetscapeµÄJavaScriptÊÇECMA-262µÚÈý°æ(ECMAScript)±ê×¼½Å±¾ÓïÑÔµÄÒ»¸ö³¬¼¯£¬Ö»Óë·¢Ðбê×¼ÓÐЩÐí²»Í¬£¨mild differences£©¡£
Óë¹ã·ºµÄÎó½âÏà·´£¬JavaScript²»ÊÇ“½âÊÍÐ͵ÄJava”¡£×¼È·µÄ˵£¨In a nutshell£©£¬JavaScriptÊÇÖ§³Ö ......

ÓÃJavaScriptʵÏÖä¯ÀÀÆ÷״̬À¸·ÉÈëÎÄ×Ö

 //״̬À¸·ÉÈëÎÄ×Ö
function statusMessageObject(p,d) {  <!--????????????-->
  this.msg = MESSAGE
  this.out = " "
  this.pos = POSITION
  this.delay = DELAY
  this.i     = 0
  this.reset = clearMessage
}
function clearMessage( ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ