ASP.NET AJAX ½Ìѧ±Ê¼Ç(Èý) 2
3.4Àí½â¼Ì³Ð
Ò»£®»ùÓÚÔÐ͵ļ̳Уº
²½Ö裺
(1)ÔÚ×ÓÀ๹Ô캯ÊýÖе÷ÓûùÀ๹Ô캯Êý£¬´Ó¶ø¼Ì³Ð»ùÀàµÄÊôÐÔ¡£
(2)½«»ùÀàµÄÒ»¸öÐÂʵÀý¸³¸ø×ÓÀ࣬´Ó¶ø¼Ì³Ð»ùÀàµÄ·½·¨¡£
Samples.Cat=function()
{
Samples.Pet.call(this);
}
Samples.Cat.prototype =new Samples.Pet(); //²âÊÔ´úÂë
Samples.Pet.registerClass('Samples.Pet');
Samples.Cat.registerClass('Samples.Cat');
µ÷Óãº
var cc=new Samples.Cat();
cc.set_name("°×è");
cc.speak();
¸²¸Ç·½·¨£º
Samples.Cat.prototype.speak=function (){alert ('meeeewooooo')};
¶þ£®Microsoft Ajax Library´ÓÒ»¸ö»ùÀàÅÉÉú×ÓÀà
function Pet()
{
this._name;
this._age;
}
Pet.prototype={
speak:function (){
alert (this._name+"Meeeeooow"); }
}
Cat=function (){
Cat.initializeBase(this ); //´¦Àí¼Ì³Ð²¢µ÷ÓûùÀ๹Ô캯Êý
Samples.Cat.registerClass('Samples.Cat',Samples.Pet)
µ÷Ó㺴úÂë²»±ä
¸²¸Ç·½·¨£º
Samples.Cat.prototype={
speak:function (){
alert ("Meeeeooow");
}
}
²âÊÔ£º´úÂë²»±ä
3.4.2Ïò»ùÀà´«µÝ²ÎÊý
Samples.Pet= function (name ,age)
{
this._name=name ;
this._age=age;
}
…..
Samples.Cat=function (name,age)
{
Samples.Cat.initializeBase(this,[name,age]);
}
……&hel
Ïà¹ØÎĵµ£º
Ê×ÏÈÔÚfademo.mxmlÖÐÉùÃ÷Ò»¸öbutton£¬²¢Ìí¼ÓÒ»¸öbtnClick·½·¨£º
view plaincopy to clipboardprint?
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
......
×î½üÍøÉÏÌáµÄºÜ¶àµÄÒ»¸öиÅÄî¾ÍÊÇ AJAX ÁË, ÄÇô, AJAX ÊÇÊ²Ã´ÄØ? ÒÔÏÂÄÚÈÝÒýÓÃÍøÉÏ×ÊÁÏ:
AJAXÈ«³ÆÎª“Asynchronous JavaScript and XML”£¨Òì²½JavaScriptºÍXML£©£¬ÊÇÖ¸Ò»ÖÖ´´½¨½»»¥Ê½ÍøÒ³Ó¦ÓõÄÍøÒ³¿ª·¢¼¼Êõ¡£ËüÓлúµØ°üº¬ÁËÒÔϼ¸ÖÖ¼¼Êõ£º
Ajax£¨Asynchronous JavaScript + XML£©µÄ¶¨Òå
»ùÓÚ web±ê×¼£¨sta ......
µÚÒ»Õ ASP.NET Ajax¼ò½é
1.1ʲôÊÇAjax
Ò»£®Ê²Ã´ÊÇAjax
AjaxÊÇAsynchronous JavaScript and XML(Òì²½JavaScript ºÍXML)µÄËõд£¬ÓÉÖøÃûÓû§ÌåÑéר¼ÒJesse-James GarrettÔÚ2005Äê2ÔÂ18ÈÕ·¢±íµÄһƪÃûΪAjax:a New Approach to Web ApplicationsÎÄÕÂÖÐÊ×ÏÈÌá³ö¡£
Ajax²¢²»ÊÇÖ»°üº¬JavaScri ......
½¨Á¢Ò»¸öWEB¹¤³Ì£¬Ìí¼ÓÐÂÏî->HTMLÒ³Ãæ£¬ÃüÃûΪProgressBar.htm£¬ÄÚÈÝÈçÏ£º
<!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" id="mainWindo ......
Ajax¿ª·¢ÈËÔ±ÐèÒªµÄJavaScript֪ʶ
JavaScriptµ®ÉúÓÚ1995 Ä꣬×î×³ÉÔÚNetsCape Navigatorä¯ÀÀÆ÷ÖС£Microsoft ÔÚIE3Öм¯³É¡£1998Äê±»±ê×¼»¯ÎªECMAScript.
Microsoft Ajax Library¸ÄÉÆÁËJavaScriptµÄÃæÏò¶ÔÏóÄ£ÐÍ¡£
3.1ʹÓöÔÏó
JavaScriptÖеĶÔÏó²¢²»ÊÇÀàÐ͵ÄʵÀý£¬ÒòΪJavaScript²»Ö§³ ......