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

javascriptÃæÏò¶ÔÏóѧϰ

¼ò½é

ÔÚjavascript
ÖÐÎÒÃÇ×îͨ³£µÄ×ö·¨ÊǶ¨ÒåÒ»¸öÒ»¸öµÄ·½·¨(function)
£¬È»ºóͨ¹ý¸ö¸öfunction
Ö®¼äµÄµ÷ÓÃÀ´ÊµÏÖij¸ö¹¦ÄÜ£¬Ò²¾ÍÊÇ¿ÉÒÔÕâÑù½²£¬function
ËƺõÊÇjs
ÖеÄÒ»¸ö×îС×éÖ¯µ¥Ôª,
ÎÒÃÇÒѾ­ÊìϤÁ˸÷ÖÖÃæÏò¶ÔÏó¶ÔÏóÓïÑÔ(java,c#..),
ÎÒÃÇÒѾ­Ï°¹ßÁËʹÓø÷¸÷ÀàÀ´·â×°¸÷¸ö²Ù×÷£¬Èúóͨ¹ý¸÷¸ö¶ÔÏóÖ®¼äµÄ½»»¥À´ÊµÏÖijһ¸ö¹¦ÄÜ£¬JavaScript
ÊÇ·ñÒ²Ö§³ÖÃæÏò¶ÔÏó²Ù×÷ÄØ?
½ÓÏÂÀ´½«ÒÔdemo
·½Ê½À´ÑÝʾjavascript
ÃæÏò¶ÔÏóµÄʵÏÖ·½Ê½
1.
·â×°
ÎÒÃǽ«Ò»¸ö×î¼òµ¥µÄÀý×ÓÀ´ÑÝʾ£¬¶¨ÒåÒ»¸öStudent
À࣬ÓÐÃû×ÖºÍÄêÁäÊôÐÔ
1.1
½èÓÃÒÑÓеÄObject
¶ÔÏóʵÏÖ
javascript
ÖÐÓÐÒ»¸ö»ù±¾¶ÔÏóObject,
×î¼òµ¥µÄ·½Ê½£¬ÎÒÃÇ¿ÉÒÔÕâÑù¶¨ÒåÒ»¸öÀà
var
student = new Object();
student.name
= “zhangsan”;
student.age
= 23;

Õâ¸öÀàÖ»ÓÐÁ½¸öÊôÐÔname
Óëage
£¬ÎÒÃÇ¿ÉÒÔͨ¹ýstudent.name
À´»ñÈ¡ÐÕÃû£¬µ«¶¨ÒåÕâÑùµÄÀàÆäʵÁÓÊƺÜÃ÷ÏÔ£ºÀàµÄ·â×°²¢²»Ö±¹Û£¬ÓÐûÓиüºÃµÄʵÏÖ·½Ê½ÄØ£¿
Var
Student = function(name,age){//
»òfunction
Student(name,age){..
this.name
= name;
this.age
= age;
}
var
student = new Student('zhangsan',23);
alert(student.name);

Õâ¶Î´úÂëʵÏֵŦÄܺÍÉÏÃæµÄ´úÂë×÷ÓÃÊÇÒ»ÑùµÄ£¬µ«ÊÇÕâÖÖ·½Ê½µÄʵÏÖ¸ü¼ÓÖ±¹ÛÁË£¬¸ü¼Ó½Ó½üÓÚÎÒÃDZȽÏÊìϤµÄjava
·ç¸ñµÄÀඨÒ巽ʽ,this
Ò²ÊÇjavascript
ÖеĹؼü×Ö£¬×÷ÓúÍjava
ÖеÄthis
ÀàËÆ£¬±íʾָÏò×ÔÉíµÄÒ»¸öÖ¸Õë

ÓÐÀàÊôÐÔ£¬½ÓÏÂÀ´ÎÒÃǾͿÉÒÔ¶ÔÕâÁ½¸öÊôÐÔ½øÐвÙ×÷ÁË£¬Õâʱºò¾ÍÊÇ·½·¨·¢»Ó×÷ÓõÄʱºòÁË£¬¶¨ÒåÀàµÄ·½·¨Í¨³£Ò²ÓÐÁ½ÖÖ·½Ê½
1.2
·â×°ÔÚÀàµÄÄÚ²¿
var
Student = function(name,age){
this.name
= name;
this.age
= age;
this.getAge
= function(){
return
this.age;
};
this.setAge
£½ function(age){
this.age
= age;

};
this.getName=function(){
return
this.name;
};

this.setName=function(name){
this.name
= name;

};
}
var
student = new Student('zhangsan',23);

alert(student.getName());//
ÏÔʾ
zhangsan

student.setName(‘
ÕÅÈý’);//
ÐÞ¸ÄÒ»ÏÂÃû×Ö

alert(s


Ïà¹ØÎĵµ£º

ͨ¹ýjavascript»ñµÃurl²ÎÊý

Ò³ÃæÌá½»Êý¾ÝÒ»°ãÓÐÁ½ÖÖ·½·¨£ºget,post¡£post¾ÍÊÇËùνµÄformÌá½»£¬Ê¹ÓÃÊÓͼ£»getÊÇͨ¹ýurlÌá½»¡£
Get·½·¨Ò»°ãÓúǫ́´úÂ루Èçasp,asp.net£©»ñµÃ²ÎÊý£¬´úÂëºÜ¼òµ¥£ºRequest.QueryString["id"];¼´¿É»ñÈ¡¡£ 
ÓÐЩʱºòÐèÒªÖ±½ÓÔÚǰ̨»ñÈ¡url²ÎÊý£¬ÒªÓõ½javascript£¬jsûÓÐÖ±½Ó»ñÈ¡url²ÎÊýµÄ·½·¨£¬ÄÇô£¬ÎÒÃÇÈçºÎͨ¹ýjs ......

ÈçºÎÓÃjavascript JQuery ÅжÏͼƬÊÇ·ñ´æÔÚ£¡£¡£¡

¸öÈ˼ǼÔÚ°¸£¬ÒÔÃâÒÅÍü¡£
<!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>
    <title>ÎÞ±êÌâÒ³</title>
    <s ......

Javascript ¸÷ÖÖÊý¾ÝÀàÐ͵Äת»¯


È¡Öµ·½·¨£º
¶ÔÓ¦µÄ²¼¶ûÖµ: !!value
ÊÇ·ñ==1ºÍtrue: value == true
ÊÇ·ñ==0ºÍfalse: value == false
Êý¾ÝÀàÐͶÔÓ¦µÄ²¼¶ûÖµÊÇ·ñ==1ºÍtrueÊÇ·ñ==0ºÍfalse
×Ö·û´® 'abc'
true
false
false
×Ö·û´® '0'
true
false
true
¿Õ×Ö·û´®
false
false
true
´øÒ»¸ö¿Õ¸ñµÄ×Ö·û´®
true
false
true
Êý×Ö1
true
true ......

15¸öJavaScript Web UI¿â

¡¡¡¡¼¸ºõËùÓеĸ» Web Ó¦Óö¼»ùÓÚÒ»¸ö»ò¶à¸ö Web UI ¿â»ò¿ò¼Ü£¬ÕâЩ UI ¿âÓë¿ò¼Ü¼«´óµØ¼ò»¯ÁË¿ª·¢½ø³Ì£¬²¢´øÀ´Ò»Ö£¬¿É¿¿£¬ÒÔ¼°¸ß¶È½»»¥ÐÔµÄÓû§½çÃæ¡£±¾ÎĽéÉÜÁË15 ¸ö·Ç³£Ç¿´óµÄ JavaScript Web UI ¿â£¬·Ç³£Êʺϸ÷ÖÖ¸÷ÖÖ¹æÄ£µÄ¸» Web Ó¦ÓõĿª·¢¡£
¡¡¡¡LivePipe
¡¡¡¡LivePipe UI »ùÓÚ Prototype Javascript ¿ò¼Ü£¬°üº¬ÁË ......

Cookies½ÒÃØ [Asp.Net, Javascript]

Ò»£¬Ç°ÑÔ
CookiesÏë±ØËùÓÐÈ˶¼Á˽⣬ µ«ÊÇδ±ØËùÓÐÈ˶¼¾«Í¨¡£±¾ÎĽ²½âÁËCookiesµÄ¸÷·½Ãæ֪ʶ£¬ ²¢ÇÒÌá³öÀ´ÁË×î¼Ñʵ¼ù¡£ÕâÊDZÊÕßÔÚÈÕ³£¹¤×÷ÖеĻýÀۺͳÁµí¡£
¶þ£¬»ù´¡ÖªÊ¶
1.ʲôÊÇCookies
Cookie ÊÇһС¶ÎÎı¾ÐÅÏ¢£¬°éËæ×ÅÓû§ÇëÇóºÍÒ³ÃæÔÚ Web ·þÎñÆ÷ºÍä¯ÀÀÆ÷Ö®¼ä´«µÝ¡£Cookie °üº¬Ã¿´ÎÓû§·ÃÎÊÕ¾µãʱ Web Ó¦ÓóÌÐò¶¼¿ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ