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

javascriptдÀ෽ʽ֮ʮ

10¡¢mootools.jsµÄдÀ෽ʽ
mootools.jsµÄ×îа汾ÊÇ1.2.3,ÕâÀïʹÓõÄÊÇ1.2.0¡£mootool±»Éè¼Æ³É·Ç³£½ô´ÕµÄ£¬Ä£¿é»¯µÄ£¬ÃæÏò¶ÔÏóµÄµÄjs¿â¡£mootoolÖÐдÀàÓÃClassÀà¡£ClassÀàÓÉNativeÀànew³öÀ´µÄ£º
/*
*Script: Class.js
*/
var Class = new Native({
name: 'Class',
initialize: function(properties){
properties = properties || {};
var klass = function(empty){
for (var key in this) this[key] = $unlink(this[key]);
for (var mutator in Class.Mutators){
if (!this[mutator]) continue;
Class.Mutators[mutator](this, this[mutator]);
delete this[mutator];
}
this.constructor = klass;
if (empty === $empty) return this;

var self = (this.initialize) ? this.initialize.apply(this, arguments) : this;
if (this.options && this.options.initialize) this.options.initialize.call(this);
return self;
};
$extend(klass, this);
klass.constructor = Class;
klass.prototype = properties;
return klass;
}
});

Native·½·¨ÊÇmootoolsÖÐÒ»¸ö·Ç³£ÖØÒªµÄ·½·¨£¬ºÜ¶àÀ඼ÓÃËüÈ¥×é×°¡£ÈçWindow,Document,Event¡£µ±È»»¹ÓÐÕâÀïµÄClass£¬µ¼ÈëmootoolsºóÎÒÃÇдÀàʱֻÐèÒªÓÃClass¾ÍÐÐÁË¡£Ò»¸öPersonÀࣺ
/**
* PersonÀà
* @param {Object} name
*/
var Person = new Class({
initialize: function(name){
this.name = name;
},
setName : function(name) {
this.name = name;
},
getName : function() {
return this.name;
}
})
//newÒ»¸ö¶ÔÏó
var p = new Person("jack");
//²âÊÔset£¬get·½·¨
console.log(p.getName());//jac
p.setName('andy');
console.log(p.getName());//andy
//²âÊÔinstanceof¼°p.constructorÊÇ·ñÕýÈ·Ö¸ÏòÁËPerson
console.log(p instanceof Person); //true
console.log(p.constructor == Person); //true

Nativeʵ¼ÊÉÏÖ»ÊÇÒ»¸öÆÕͨº¯Êý£¬Ëüͨ¹ýËù´«²ÎÊý×é×°ÁËÒ»¸öÀࣨfunction£©£¬×îºó·µ»Ø¸ÃÀࣨfunction£©¡£¼ÈÈ»NativeÊǺ¯Êý£¬º¯
Êýµ÷Óõķ½Ê½ÊÇ(),call,apply¡£µ«ÔÚmootoolsÖÐÈ´ÓÃnew
Native(obj)·½Ê½¡£ÎªºÎ£¿Ô­ÒòÖ»ÊÇʹNative¿´ÆðÀ´¸üÏñÒ»¸öÀà¶øÒÑ¡£¼û¾ßÃûº¯ÊýµÄËÄÖÖµ÷Ó÷½Ê½£¨3£©


Ïà¹ØÎĵµ£º

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

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

javascriptÖм¸ÖÖ²Ù×÷´òÓ¡µÄ·½·¨

1¡¡¾Ö²¿´òÓ¡·½·¨£º
×÷Ó㺽«idΪdayinµÄÄÚÈÝ£¬Ð½¨Ò³Ãæ²¢´òÓ¡£¬¿É½â¾ö´òӡijҳÃæÖеIJ¿·ÖÄÚÈݵÄÎÊÌâ¡£
ʹÓ÷½·¨£º½«Òª´òÓ¡µÄÄÚÈÝͨ¹ý <span id="dayin"></span>°üº¬ÆðÀ´£¬È»ºóÔÚij¸ö°´Å¤Öж¨Òå
ʼþ
<input type="button" onclick="dayin()" value="´òÓ¡">
function dayin()  
{
  ......

15 ¸ö JavaScript Web UI ¿â

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

15 ¸ö JavaScript Web UI ¿â


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

javascriptдÀ෽ʽ֮Îå

5¡¢Óà ¹¹Ô캯Êý+Ô­ÐÍ ¶¨ÒåÒ»¸öÀࣻͬһ¹¹Ô캯Êý¿ÉÒÔ¶¨Òå³ö¶à¸öÀàÐÍ



/**
* $define дÀ๤¾ßº¯ÊýÖ®¶þ
* @param {Object} constructor
* @param {Object} prototype
*/
function $define(constructor,prototype) {
var c = constructor || function(){};
var p = prototype || {};
r ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ