javascriptдÀ෽ʽ֮¾Å
9¡¢YUIµÄдÀ෽ʽ
ÕâÀïÒýÈëµÄÊÇYUI 2.7.0°æ£¬Ö»ÐèÒýÈëyahoo.js¡£YUIÒýÈëÁËÃüÃû¿Õ¼ä£¬ÀàËÆÓÚjavaµÄ°ü¡£ÒÔÏÂyahooµÄ¹¤¾ßº¯Êý°ü
YAHOO.namespace
YAHOO.lang
YAHOO.lang.hasOwnProperty
YAHOO.lang.extend
YAHOO.lang.augment
YAHOO.log
YAHOO_config and YAHOO.env
YUI Module Names
дÀ෽ʽ£º
//¶¨Òå°üÃû
YAHOO.namespace("test");
//¶¨ÒåÀà
YAHOO.test.Person = function(name) {
this.name = name;
}
YAHOO.test.Person.prototype.setName = function(name){ this.name = name;}
YAHOO.test.Person.prototype.getName = function(){ return this.name;}
//´´½¨Ò»¸ö¶ÔÏó
var p = new YAHOO.test.Person("jack");
console.log(p.getName());//jack
p.setName('tom');
console.log(p.getName());//tom
//²âÊÔinstanceof¼°p.constructorÊÇ·ñÕýÈ·Ö¸ÏòÁËYAHOO.test.Person
console.log(p instanceof YAHOO.test.Person);
console.log(p.constructor == YAHOO.test.Person);
¿ÉÒÔ¿´³ö³ýÁ˶àÁ˰üÃû£¬ÓëµÚÈýÖÖдÀ෽ʽ
²¢ÎÞÇø±ð¡£
Ïà¹ØÎĵµ£º
¡¡¡¡ÀûÓÃCookie£ºCookieÊÇä¯ÀÀÆ÷´æ´¢ÉÙÁ¿ÃüÃûÊý¾Ý.ËüÓëij¸öÌØ¶¨µÄÍøÒ³»òÍøÕ¾¹ØÁªÔÚÒ»Æð¡£
¡¡¡¡CookieÓÃÀ´¸øä¯ÀÀÆ÷ÌṩÄÚ´æ,ÒÔ±ã½Å±¾ºÍ·þÎñÆ÷³ÌÐò¿ÉÒÔÔÚÒ»¸öÒ³ÃæÖÐʹÓÃÁíÒ»¸öÒ³ÃæµÄÊäÈëÊý¾Ý¡£
¡¡¡¡Post.htm
ÒÔÏÂÊÇÒýÓÃÆ¬¶Î£º
<input type="text" name="txt1">
<input type="button" value="Post">
<s ......
// JScript Îļþ
/********************************************************/
/*Åж¨·µ»ØÖµÎªtrue»òfalse*/
/********************************************************/
//´ò¿ªÒ»¸öÐÂÁ´½Ó
function openwindow()
{
//var $j = jQuery.noConflict();
  ......
/*
ÏÞÖÆÊäÈë×Ö·ûµÄλÊý
strÊÇÓû§ÊäÈë×Ö·û´®£¬lenÊÇÒªÏÞÖÆµÄλÊý
----------------------------
*/
function isSmall(str,len){
if (str.length<len){
return(true);
&nb ......
ÔÎÄ£ºhttp://www.webreference.com/programming/javascript/rg39/ ×÷ÕߣºRob Gravelle
°æÈ¨ÉùÃ÷£º·Òë×÷Æ·£¬»¶Ó×ªÔØ£¬×ªÔØÊ±ÇëÎñ±ØÒÔ³¬Á´½ÓÐÎʽ±êÃ÷ÎÄÕÂÔʼ³ö´¦ ¡¢×÷ÕßÐÅÏ¢ºÍ±¾ÉùÃ÷¡£
ÔÚJavascript·þÎñÆ÷¶Ë±à³Ì½éÉÜÒ»ÎÄÖУ¬ÎÒÃÇѧϰÁËAptana Jaxer·þÎñÆ÷£¬ËüÊÇÒ»¸öÏñApache¡¢Jetty»òÕßTomcatÕâЩ·þÎ ......
ÕâÆª¿ªÊ¼»á·ÖÎöÁ÷ÐеÄjs¿â֮дÀ෽ʽ¡£¸÷ÖÖ¿âµÄдÀ෽ʽËäÈ»Ç§Ææ°Ù¹Ö£¬µ«ÈÔÈ»ÌÓÀë²»Á˱¾ÖÊ---Óù¹Ô캯ÊýºÍÔÐÍ
À´×é×°Àà¡£
6¡¢Prototype.jsµÄдÀ෽ʽ
//prototype.jsÖеĴúÂë
var Class = {
create: function() {
return function() {
this.initialize.apply(this, arguments);
}
}
}
//¼ò»¯ ......