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

ÒýÓà javascript¶¨Òå¶ÔÏóд·¨£¨ÕûÀí£©

ÒýÓÃ
Aaron µÄ javascript¶¨Òå¶ÔÏóд·¨£¨ÕûÀí£©
javascript¶¨Òå¶ÔÏóµÄ¼¸ÖÖ¼òµ¥·½·¨
1.¹¹Ô캯Êý·½Ê½£¬È«²¿ÊôÐÔ¼°¶ÔÏóµÄ·½·¨¶¼·ÅÔÚ¹¹Ôì·½·¨ÀïÃ涨Òå
Óŵ㣺¶¯Ì¬µÄ´«µÝ²ÎÊý
ȱµã£ºÃ¿´´½¨Ò»¸ö¶ÔÏó¾Í»á´´½¨ÏàͬµÄ·½·¨º¯Êý¶ÔÏó£¬Õ¼ÓôóÁ¿ÄÚ´æ
function User1(name, password) {
this.name = name;
this.password = password;
this.login = function(name,password){
if(this.name == name && this.password == password) {
return true;
}else {
return false;
}
};
}
2.Ô­ÐÍ·½Ê½£¬½«¶ÔÏóÊôÐÔ¼°·½·¨¶¨Ò嶼дÔÚ¶ÔÏóµÄprototypeÀïÃæ
Óŵ㣺ÿ´Î´´½¨¶ÔÏóʱ¶¼ÊÇʹÓÃÏàͬprototypeÖеķ½·¨£¬²»»áÕ¼ÓÃÖظ´µÄÄÚ´æ
ȱµã£ºÎÞ·¨¶¯Ì¬´«µÝ¹¹Ôì²ÎÊý
function User2() {
}
User2.prototype.name = "prototype name";
User2.prototype.password = "prototype password";
User2.prototype.login = function(name,password){
if(this.name == name && this.password == password) {
return true;
} else {
return false;
}
};
Ô­ÐÍ·½Ê½µÄÁíÒ»ÖÖд·¨£º
¸ñʽ£º
var ¶ÔÏóÃû = {};
    ¶ÔÏóÃû.prototype.±äÁ¿1=±äÁ¿1µÄÖµ;
    ¶ÔÏóÃû.prototype.±äÁ¿2=±äÁ¿2µÄÖµ;
    ……;
    ¶ÔÏóÃû.prototype.º¯Êý1= function() {
       º¯ÊýÌå
    };
    ¶ÔÏóÃû.prototype.º¯Êý2= function() {
       º¯ÊýÌå
    };
    ……;
˵Ã÷£º
£¨1£©       ³õʼ¶ÔÏóÌåÄÚ¿ÉÒÔ²»¶¨ÒåÈκζ«Î÷£»
£¨2£©       ÔÚÒª¶¨ÒåµÄ±äÁ¿Ç°¼Ó“¶ÔÏóÃû.prototype.”µÄ¸ñʽ£»
£¨3£©       ¶ÔÏóµÄÄÚÈÝÓëÖµÒԵȺŷָô£¬³É¶Ô³öÏÖ£»
£¨4£©       °üº¬µÄ±äÁ¿»òÕߺ¯ÊýÖ®¼äÒԷֺŷָô£¬Ò²¿ÉÒÔÊ¡È¥·ÖºÅ¡£
£¨5£©       º¯ÊýÐèҪдÔÚfunction(){}µÄ´óÀ¨ºÅÖ®ÄÚ¡£
Àý×Ó£º
var data = {};
   data.prototype. name ="Vicky”;
    data.prototype. age =20;
    data.prototype. eat = funct


Ïà¹ØÎĵµ£º

ÕÅТÏêjavascript½²×ù±Ê¼ÇÁù£¨½á¾Öƪ£©

Ò»£¬javascriptµÄÄÚ²¿¶ÔÏó£¨Ï൱ÓÚϵͳµ÷Óã¬Æäʵ±¾ÖÊÊÇÒ»¸ö¹¹Ô캯Êý£©
1£¬¶¯Ì¬¶ÔÏó
     Ê¹ÓÓ¶ÔÏóʵÀýÃû.³ÉÔ±”µÄ¸ñʽÀ´·ÃÎÊÆäÊôÐԺͷ½·¨¡££¨ÓÃnewÏÈ´´½¨¶ÔÏóʵÀý£©
2£¬¾²Ì¬¶ÔÏó
     Ö±½ÓʹÓÓ¶ÔÏóÃû.³ÉÔ±”µÄ¸ñʽÀ´·ÃÎÊÆäÊôÐԺͷ½·¨
¶þ£¬¼¸¸öÄÚÖö ......

ÕýÔò±í´ïʽ javascript ÑéÖ¤±íµ¥

дÏÂÒ»¸ö¹ØÓÚÓÃÕýÔò±í´ïʽÑéÖ¤±íµ¥µÄ´úÂ룬ÒÔºó¿ÉÒÔÓõ½¡£
function checkform(){
var null_regu = /^[ ]*$/;
var age_regu = /^[1-9][0-9]$/;
var tel_regu = /^[0-9]*(-){0,1}[0-9]{8,11}$/;
var email_regu=/^[\w]+[\w-\.]*@([\w]+\.)+[\w]+$/;
var qq_regu=/^(\d+){6,12}/;
if(new RegExp(null_regu ......

javascript¿´Ô´´úÂë

<HTML>
<HEAD>
<META http-equiv='Content-Type' content='text/html; charset=gb2312'>
<TITLE>Óð´Å¥ÏÔʾԴ´úÂë»òÕßjavascriptÀïÃæµÄÄÚÈÝ£¬ÓÐʱ»áÓÐ</TITLE>
</HEAD>
<BODY >
<script id=abc >
function dennisboys()
{
var i=0;
alert(document.documentElem ......

javaScriptÑ­Ðò½¥½ø£¨3£©


<!--
@page { margin: 2cm }
P { margin-bottom: 0.21cm }
-->
±Õ°ü£¨
closure
£©
±Õ°üÒâζ×ÅÄÚ²ãµÄº¯Êý¿ÉÒÔÒýÓôæÔÚÓÚ°üΧËûµÄº¯ÊýÄڵıäÁ¿£¬¼´Ê¹Íâ²ãº¯ÊýµÄÖ´ÐÐÒѾ­ÖÕÖ¹¡£Õâ¸öÌØÐԷdz£Ç¿´óºÍ¸´ÔÓ¡£
 
ÀýÈ磺±Õ°üÈçºÎʹ´úÂë¸üÇåÎúµÄÁ½¸öÀý×Ó
ÕÒ³ö
ID
Ϊ‘
main’
µÄÔªËØ
var ......

±éÀúJavaScript¶ÔÏóµÄËùÓÐÊôÐÔ


/*
* ÓÃÀ´±éÀúÖ¸¶¨¶ÔÏóËùÓеÄÊôÐÔÃû³ÆºÍÖµ
* obj ÐèÒª±éÀúµÄ¶ÔÏó
* author: Jet Mah
* website: http://www.javatang.com/archives/2006/09/13/442864.html 
*/ 
function allPrpos(obj) { 
    // ÓÃÀ´±£´æËùÓеÄÊôÐÔÃû³ÆºÍÖµ
    var props = "";
&nbs ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ