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

javascript Ô­ÐͶÔÏóÓëprototypeµÄ¹Øϵ

    JavascriptÖеļ̳лúÖÆÊÇËùνµÄÔ­ÐͶÔÏó¼Ì³Ð£¬Í¨¹ýÊôÐÔ·ÃÎÊ»úÖƵÄÌØÊâÐÔÀ´ÊµÏּ̳еġ£Ö®Ç°ÎÒÒ»Ö±ÒÔΪËùÓжÔÏóµÄÔ­ÐͶÔÏó¾ÍÊÇprototypeËùÖ¸µÄÄǸö¶ÔÏ󡣺óÀ´ÔÚ¿´javascriptÉè¼ÆģʽµÄʱºò·¢ÏÖ×÷Õß×¢ÖÐÓÐÒ»¾ä»°ÓëÎÒ֮ǰµÄÀí½â²»Í¬£¬Ëû˵“ÿ¸ö¶ÔÏó¶¼ÓÐÒ»¸öÔ­ÐͶÔÏ󣬵«Õâ²¢²»Òâζ×Åÿ¸ö¶ÔÏó¶¼ÓÐÒ»¸öprototypeÊôÐÔ”¡£¿´ÍêÎÒ¾ÍÓеãÃÔãÁË£¬¾ö¶¨³¹µ×°ÑÕâ¸öËÀÈ˵ÄÔ­Ðͼ̳иã¸ãÇå³þ¡£È»ºó·­ÁËЩÎÄÕºÍÊé¼®£¬×îºóÖÕÓÚÔÚjavascriptȨÍþÖ¸ÄϵÚÎå°æÖÐÕÒµ½Á˸öÈË ÈÏΪ±È½ÏȨÍþµÄ½âÊÍ¡£¹ØÓÚÔ­ÐÍÁ´ºÍÊôÐÔ·ÃÎÊ»úÖÆÎҾͲ»ÔÙ²ûÊöÁË£¬Õâ·½Ãæ¿ÉÒÔ¿´¿´RockyµÄÎÄÕ дµÄÂùÇå³þµÄ http://blog.csdn.net/rocky_j2ee/archive/2009/03/21/4012385.aspx
    ÄÇÎÒÃÇÏÈ´Ó´´½¨¶ÔÏó˵Æð£¬ÓÃnew²Ù×÷·û´´½¨¶ÔÏóµÄʱºòjavascript»á×ö3¼þÊ£º
Ê×ÏÈÊÇ´´½¨Ò»¸ö¿Õ¶ÔÏó£¨empty object£©£¬
È»ºó¶ÔÕâ¸ö¿Õ¶ÔÏóµÄÔ­ÐͶÔÏó½øÐи³Öµ£¬
×îºó°ÑÕâ¸ö¿Õ¶ÔÏó¸³Öµ¸ø¹¹Ô캯ÊýµÄthisÊôÐÔÇÒÔËÐÐÕâ¸ö¹¹Ô캯Êý¡£
function Person(name) {
    this.name = name;
}
var  p = new Person(); Ï൱ÓÚÒÔϲ½Ö裺
1. Var p = {};
2. p.[[prototype]] = Person.prototype   //ÕâÒ»²½ÊÇα´úÂ룬ʵ¼ÊÉÏÒ»¸ö¶ÔÏóµÄÔ­ÐͶÔÏóÊDz»ÄÜͨ¹ý´úÂëÀ´·ÃÎʵģ¬
                                                              //ÕâÀïÖ»ÊÇΪÁË˵Ã÷´´½¨¶ÔÏóµÄ²½Öè
3. p.methodName = Person                   //ÕâÑùµÄ»°PersonµÄthis¾Í»áÖ¸Ïòp
   p.methodName();
      Èç¹ûÄã¶ÔµÚ¶þ²½²»ÊǺÜÃ÷°×£¬ÄÇôÏÈ°Ñ´úÂë·ÅÒ»·Å£¬½ÓÏÂÀ´ÎÒ»áÏêϸ½âÊÍϵڶþ²½Ô­ÐͶÔÏóµÄ¸³Öµ£¨»òÕß˵¹¹Ô캯ÊýºÍÔ­ÐͶÔÏóµÄ¹Øϵ£©:
      ÉÏÃæÎÒÌáµ½¹ýÔÚ´´½¨ÍêÒ»¸ö¿Õ¶ÔÏóºó£¬»á³õʼ»¯Õâ¸ö¿Õ¶ÔÏóµÄÔ­ÐͶÔÏó£¬javascript»á°Ñ¹¹Ô캯ÊýµÄÒ»¸ö½Ð×öprototypeµÄÊôÐÔËùÖ¸ÏòµÄ¶ÔÏó¸³Öµ¸øµ±Ç°¿Õ¶ÔÏóµÄÔ­ÐͶÔÏó¡£ËùÓеÄfunction¶¼ÓÐÒ»¸öprototypeÊôÐÔ£¬µ±Ò»¸öfunction±»¶¨ÒåÖ®ºóÕâ¸öÊôÐԻᱻ×Ô¶¯µÄ´´½¨ºÍ³õʼ»¯¡£Ò»¸öfunction µÄprototypeÊôÐԵijõʼֵÊÇÒ»¸ö¶ÔÏó£¨an object£©£¬Õâ¸ö¶ÔÏóÖ»ÓÐÒ»¸öÊôÐÔ½Ð


Ïà¹ØÎĵµ£º

JavaScript ¹¹Ô캯Êý myhere

/**
* JavaScript ÊÇÃæÏò¶ÔÏóµÄÓïÑÔ£¬µ«ÊÇËûµÄÃæÏò¶ÔÏó²»ÊÇ»ùÓÚÀàµÄ£¬ÊÇ»ùÓÚÔ­Ð͵Ä;
* µ«ÊÇËûµÄһЩÌØÐÔ(º¯ÊýÊÇÊý¾Ý)£¬Ê¹µÃËü¿ÉÒÔÄ£Äâ»ùÓÚÀàµÄÃæÏò¶ÔÏ󣬵«ÊÇ JavaScript ²¢²»Ö§³ÖºÍ Java Ò»ÑùµÄÀ࣬
* Òò´Ë JavaScript ÖеÄ"Àà"¿ÉÒÔ³Æ×÷"αÀà"
*/
//
/**
* ¹¹Ô캯Êý: js ÖÐÓÃÀ´ºÍ new ÔËËã·ûÒ»ÆðʹÓõĺ¯Êý³Æ× ......

Javascriptµ¼³öExcel

<!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>
<meta http-equiv="Content-Type" content="text/html; ......

ÀûÓÃhttpµÄrefererÍ·ºÍServletÒþ²ØJavaScript´úÂë

1.       ¶¨ÒåÒ»¸öÓÃÓÚÊä³öJavaScript´úÂë µÄServletÀà¡£
package com.mycompany.response.servlet;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServle ......

Javascript µÄ´Ê·¨×÷ÓÃÓò¡¢µ÷ÓöÔÏóºÍ±Õ°ü

×÷ÓÃÓò Scope
Javascript Öеĺ¯ÊýÊôÓÚ´Ê·¨×÷ÓÃÓò£¬Ò²¾ÍÊÇ˵º¯ÊýÔÚËü±»¶¨ÒåʱµÄ×÷ÓÃÓòÖÐÔËÐжø²»ÊÇÔÚ±»Ö´ÐÐʱµÄ×÷ÓÃÓòÄÚÔËÐС£ÕâÊÇϬţÊéÉϵÄ˵·¨¡£µ«“¶¨Òåʱ”ºÍ“Ö´ÐУ¨±»µ÷Óã©Ê±”ÕâÁ½¸ö¶«Î÷ÓÐЩÈ˸㲻Çå³þ¡£¼òµ¥À´Ëµ£¬Ò»¸öº¯ÊýAÔÚ“¶¨Òåʱ”¾ÍÊÇ function A(){} Õâ¸öÓï¾äÖ´ÐеÄʱºò¾Í ......

javascript¿ØÖÆtextbox×ÖÊýµÄ½Å±¾ ·Ç³£ºÃÓÃ

ÒÔÇ°×öÏîĿʱºò¾­³£Óõ½¶àÐÐÊäÈë¿ò×ÖÊýµÄ¿ØÖÆÒÔ¼°Í³¼ÆÏÔʾµÄÇé¿ö£¬×ÛºÏÁ˼¸ÖÖÇé¿öºóÏÖÔڹ̶¨ÓÃÁËÕâ¸ö½Å±¾¡£
ÀýÈç ÒªÊäÈëÃèÊötextbox
<div>
<h3>
ÃèÊö£º</h3>
<asp:TextBox runat="server" ID="tbdesciption" Height="200px" TextMode="MultiLine" onkey ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ