锘??xml version="1.0" encoding="utf-8" standalone="yes"?>99人中文字幕亚洲区,亚洲午夜久久久精品影院,亚洲第一男人天堂http://www.tkk7.com/javaora/category/7731.htmlzh-cnTue, 27 Feb 2007 09:19:51 GMTTue, 27 Feb 2007 09:19:51 GMT60Dojo鐨勮璁″摬瀛?/title><link>http://www.tkk7.com/javaora/archive/2006/07/07/57156.html</link><dc:creator>java涓栫晫鐣呰皥</dc:creator><author>java涓栫晫鐣呰皥</author><pubDate>Fri, 07 Jul 2006 08:46:00 GMT</pubDate><guid>http://www.tkk7.com/javaora/archive/2006/07/07/57156.html</guid><wfw:comment>http://www.tkk7.com/javaora/comments/57156.html</wfw:comment><comments>http://www.tkk7.com/javaora/archive/2006/07/07/57156.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/javaora/comments/commentRss/57156.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/javaora/services/trackbacks/57156.html</trackback:ping><description><![CDATA[Dojo鐨勮璁″摬瀛?br /><br /><strong>Understanding Your Own Footprint<br />鐞嗚В浣犺嚜宸辯殑瓚寵抗</strong><br />Every useful system carries the imprint of its designers. From bridges to spoons, the expression of a builder's skill, philosophies, and production constraints are exposed in the final product. Software is no different, except in its propensity to change. Software mutates in response to users needs, and in that change, a continual re-impriting of a designer's skill and sense of taste takes place.<br />姣忎竴涓湁鐢ㄧ殑緋葷粺鐣欎笅瀹冪殑璁捐甯堢殑鐑欏嵃銆備粠妗ユ鍒板嫼瀛愶紝涓涓緩閫犺呮妧宸х殑琛ㄨ揪錛屽摬瀛﹀錛屽拰浜у搧綰︽潫鍦ㄦ渶緇堢殑浜у搧涓鏆撮湶銆傝蔣浠舵槸涓嶅悓鐨勶紝闄や簡瀹冪殑鍙樺寲鐨勫懼悜銆傚湪鐢ㄦ埛闇瑕佺殑鍙嶅簲涓殑杞歡鍙樺紓錛屽拰鍦ㄩ偅縐嶆敼鍙樹腑錛屼竴涓繛緇殑閲嶅鐨勪笉鍙兘鐨勪竴涓璁″笀鐨勬妧宸у拰鍛寵浜х敓銆?br />This has the potential to cause continuity problems for others, be they end users or other developers. Reducing these confusing aspects (cognitive load) allows software consumers of every type to feel better about a block of code. With every interaction, their pre-conceived notions of how the thing will behave serve them instead of forming an obstacle for them to overcome. Their instincts are turned into a valuable tool by elegantly and consistently designed software.<br />榪欐槸涓哄叾浠栦駭鐢熸寔緇棶棰樼殑鏈川錛屾槸浠栦滑鏈緇堢敤鎴鋒垨鍏朵粬寮鍙戣呫傚噺灝戣繖浜涙販涔辯殑鏂歸潰錛堣鐭ョ殑璐熻嵎錛夊厑璁告瘡涓縐嶇被鍨嬬殑杞歡娑堣垂鑰呮劅瑙夋洿濂藉叧浜庝竴浜涗唬鐮併備即闅忔瘡涓嬈′氦浜掞紝浠栦滑鐨勯璁炬兂鐨勬蹇墊槸榪欎簺涓滆タ濡備綍榪愯漿鏈嶅姟浠栦滑鑰屼笉鏄粍鎴愪竴涓負浠栦滑璺ㄨ秺鐨勯殰紕嶃備粬浠殑鏈兘鏄氳繃浼樼編鍜屼竴璐湴璁捐鐨勮蔣浠跺彉鎴愪竴涓湁浠峰肩殑宸ュ叿銆?br />Dojo, as a project, should meet expectations in this way. This doesn't mean that you have to agree with every design decision that's been made in the project (dissent is healthy) or that the guiding principles outlined here are written in stone. They should, however, capture the way design choices have been made to date and serve as a guide for making future decisions.<br />聽聽聽聽 Dojo錛屼綔涓轟竴涓」鐩紝搴旇婊¤凍榪欐牱鐨勬湡鏈涖傝繖涓嶆剰鍛寵繖浣犱笉寰椾笉鍚屾剰姣忎竴涓璁″喅瀹氾紝鍗沖畠宸茬粡鍚戦」鐩腑榪涘叆錛堜笉鍚屾剰鏄仴搴風殑錛夋垨鑰呴偅鍐欏叆鐭沖ご涓殑瀵煎悜鍘熺悊杞粨銆備粬浠簲璇ユ槸錛岀劧鑰岋紝鎹曟崏璁捐閫夋嫨鐨勬柟娉曞凡緇忔彁鍒版棩紼嬪拰浣滀負鏈潵鍐沖畾鐨勫悜瀵箋?br /><br /><strong>Dojo Guiding Principles<br />Dojo鐨勮璁″鍚戝師鍒?/strong><br />Reduce barriers to adoption. <br />閲囩敤鍑忓皯闅滅鐗┿?br />Simply put, do not give users reasons not to choose your code. This affects everything from design to licensing to packaging. <br />綆鍗曟斁緗紝浣嗘槸涓嶇粰鐢ㄦ埛涓嶄嬌鐢ㄤ綘浠g爜鐨勫師鍥犮傝繖褰卞搷浠庤璁″埌涓撳埄鐨勫寘瑁呯殑姣忎歡浜嬫儏銆?br />Simple first, fast later <br />綆鍗曚紭鍏堬紝蹇湪鍚?br />Make it simple to use first, make it fast when it's approprite. Simple here means simple for users, not for us. We should work as hard as necessary to make things simple for end users. This principle goes to reducing barriers to adoption. Things should be as easy as possible for the common case but transparently "upgradeable" to a faster code path if the end user is willing to learn about the performance dials and knobs. <br />棣栬鐨勭畝鍗曚嬌鐢紝褰撳畠鏄傚悎鐨勫皢瀹冩墦涓婄粨銆?綆鍗曡繖閲屾剰鍛寵繖瀵圭敤鎴風畝鍗曪紝涓嶆槸瀵規垜浠傛垜浠簲璇ヤ嬌宸ヤ綔瀵規渶緇堢敤鎴峰敖鍙兘鐨勫彉寰楃畝鍗曘傝繖浜涘師鍒欏畾浣嶅湪閲囩敤鍑忓皯闅滅鐨勫師鍒欍備簨鎯呭簲璇ュ敖鍙兘瀹規槗瀵瑰叡鍚岀殑鎯呭艦浣嗘槸鏄庢樉鈥滃彲鍗囩駭鐨勨濆涓涓揩閫熺殑浠g爜璺緞 濡傛灉緇堢鐢ㄦ埛鎯寵浜嗚В鎵ц鐨勮〃鐩樺拰鏃嬮挳銆?br />Bend to the constraints of your environment <br />娣峰悎浣犵幆澧冪殑綰︽潫<br />Do not bludgeon a problem to death with code. If the environment can do most of something, let it. Fill in as necessary, but do not re-invent. Make the path smooth for users, but do not introduce your own idioms where they aren't required. <br />涓嶈媯掑嚮涓涓棶棰樻潵浼撮殢浠g爜姝諱骸銆傚鏋滆繖涓幆澧冨彲浠ュ仛澶ч儴鍒嗘槸浜嬫儏錛岃瀹冨仛銆傚敖鍙兘鏇夸唬錛屼笉瑕侀噸鏂板彂鏄庛傚鐢ㄦ埛鏉ヨ灝嗚礬寰勫鉤婊戯紝褰撲粬浠笉闇瑕佺殑鍦版柟涓嶈浠嬬粛浣犺嚜宸辯殑鏂硅█銆?br /><br /><strong>Improving From Here<br />浠庤繖閲屾敼榪?/strong><br />Dojo may not yet completely embody the principles outlined here, but it is their purpose to serve as a guide for the project when making determinations how things should change.<br />Dojo鍙兘娌℃湁瀹屽叏鍖呭惈榪欓噷杞粨鐨勫師鍒欙紝浣嗗畠鏄綋鎻忚堪榪欎簺浜嬫儏搴旇濡備綍鏀瑰彉,浠栦滑浣滀負涓涓悜瀵煎欏圭洰鏉ユ湇鍔$殑鐩殑銆?br />If you think that Dojo has not yet met one or more of these goals in a particular way, please raise the issue on one of the project mailing lists or file a bug.<br />濡傛灉浣犺涓篋ojo榪樻病鏈夋弧瓚沖湪鐗瑰畾鏂規硶涓殑涓涓垨澶氫釜榪欎簺鐩爣錛岃鎻愬嚭涓涓猧ssue鍦ㄤ竴涓」鐩偖浠跺垪琛ㄦ垨鏂囦歡浣滀負涓涓猙ug銆?br /><img src ="http://www.tkk7.com/javaora/aggbug/57156.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/javaora/" target="_blank">java涓栫晫鐣呰皥</a> 2006-07-07 16:46 <a href="http://www.tkk7.com/javaora/archive/2006/07/07/57156.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Ajax in acion 闃呰絎旇(1)http://www.tkk7.com/javaora/archive/2006/02/22/31996.htmljava涓栫晫鐣呰皥java涓栫晫鐣呰皥Wed, 22 Feb 2006 10:55:00 GMThttp://www.tkk7.com/javaora/archive/2006/02/22/31996.htmlhttp://www.tkk7.com/javaora/comments/31996.htmlhttp://www.tkk7.com/javaora/archive/2006/02/22/31996.html#Feedback0http://www.tkk7.com/javaora/comments/commentRss/31996.htmlhttp://www.tkk7.com/javaora/services/trackbacks/31996.htmlA  web browser provides two input mechanisms out of the box:hyperlinks and

HTML forms.

Second, the requests themselves are asynchronous,meaning that the

contextual links, zoom control , and the other page features remain

accessible while the map is gathering new data.

The four main components of Ajax:Javascript defines business rules and

program flow. The Document Object Model and Cascading Style Sheets allow

the application to reorgnize its appearance in response to data feteched in

the background from the server by the XMLHttpRequest object or its close

cousins.

We've hightlighted a few more here , to demonstrate the breadth of concerns

to which CSS can be applied:
(1)on-screen placement
(2)texturing elements
(3)assisting in layout of elements
(4)placing text relative to accompanying graphics

The DOM presents an HTML document as a tree structure , with each element

representing a tag in the HTML markup.


Working with the DOM using Javascript

An Example:
window.onload=function(){
   var hello=document.getElementById('hello');
   hello.className='declared';

   var empty = document.getElementById('empty');
   addNode(empty,"reader of");
   addNode(empty,"Ajax in action");

   var children = empty.childNodes;
   for (var i=0;i<children.length;i++){
      children[i].className='programmed';
   }
  
   empty.style.border='solid green 2px';
   empty.style.width='200px';
}

function addNode(el,text){
   var childEl = document.createElement('div'); --create new element
   el.appendChild(childEl);
   var txtNode=document.createTextNode(txt); --create text element
   childEl.appendChild(txtNode);
}

A third method worth mentioning allows us to make a shortcut through

documets that we haven't tagged with unique IDs. DOM nodes can also be
searched for based on their HTML tag type,usinf getElementByTagName(). For

example , document.getElementByTagName('UL') will return an array of all

<UL> tags in the document.

FINDING A DOM NODE
CREATING A DOM NODE

Adding styles to your document:
hello.className='declared';
empty.style.border="solid green 2px";


innerHTML

refactoring 閲嶆瀯

Working with DOM elements
A web page is exposed to Javascript through the Document Object Model

(DOM),a tree-like structure whose elements correspond to the tags of an

HTML document. When manipulating a DOM tree progarmmatically ,it is quite

common to want to find out an element's position on the page.

Unfortunately,browser vendors have provided various nonstandard methods for

doing so over the years,making it diffcult to write fail-safe cross-browser

code to accommplish the task.

window.onloadListeners = new Array();
window.addOnLoadListener(listener){
   window.onloadListener[window.onloadListeners.length]=listener;
}

window.onload=function(){
   for(var i=0;i<window.onloadListeners.length;i++){
     var func = window.onloadListeners[i];
  }
}

//------------------------------------------
Reusing user action handlers:鍛戒護妯″紡

function buttonOnClickHandler(event){
  var data = new Array();
  data[0]=6;
  data[1]=data[0]/3;
  data[2]=data[0]*data[1]+7;
  var newRow = createTableRow(dataTable);
  for (var i=0;i<data.length;i++){
     createTableCell(newRow,data[i]);
  }
}
buttonDiv.onclick=buttonOnClickHandler;

//------------------------------------
Keeping only one reference to a resource:Singleton pattern

function TradingMode(){
  this.mode=MODE_RED;
}

TradingMode.prototype.setMode=function(){

}

TradingMode.instance = new TradingMode();

var TradingMode={
   mode:MODE_RED,
   setMode:function(){
    ...
   }
};

鍩轟簬妯℃澘鐨勭郴緇燂細


Prototype:
Prototype鏄竴涓負Javascript緙栫▼鎻愪緵澶氱敤閫旂殑鍔╂墜綾誨簱錛屼嬌鐢ㄤ竴涓鍚戞墿灞?/P>

Javascript璇█鑷繁鏀寔涓涓狾O緙栫▼鏂瑰紡銆侾rototype鏈変竴涓湁鐗硅壊鐨凧avascript緙栫爜

鏍峰紡錛屽熀浜庤繖浜涘凡緇忓鍔犵殑璇█鐗規с傝櫧鐒禤rototype緙栫爜鑷韓寰堥毦闃呰錛屼粠Java/C#/

鏍峰紡涓縐婚櫎瀛樺湪寰堜箙浜嗭紝浣跨敤Prototype錛屽拰鍐呭緩鍦ㄥ畠涓婄殑錛屾槸鐩存帴鐨勩侾rototype

鍙互鑰冭檻涓虹被寮鍙戣呮彁渚涚被銆侫Jax搴旂敤紼嬪簭浣滆呮洿澶氬笇鏈涗嬌鐢ㄧ被寤虹珛綾昏屼笉鏄嬌鐢?/P>

Prototype鑷韓銆傛垜浠皢鏌ヨ榪欎簺綾誨湪涓嬮潰鐨勯儴鍒嗕腑銆傚湪鏈熼棿錛屼竴涓富瑕佺殑鍏充簬

Prototype鏍稿績鐨勭壒鎬ц璁哄皢甯姪浠嬬粛瀹冭嚜韜殑緙栫爜鐨勬牱寮忓拰灝嗗湪鎴戜滑璁ㄨ

Scriptaculous銆丷ico鍜孯ubt on Rail.
銆銆Prototype鍏佽涓涓璞℃墿灞曢氳繃澶嶅埗鎵鏈夌殑鐖跺璞$殑灞炴у拰鏂規硶緇欏瓙鍏朵粬銆傝繖涓?/P>

鐗規ф槸鏈濂界殑涓句釜渚嬪瓙,璁╂垜浠湅涓涓嬪畾涔夌殑Vehicle鐖剁被
function Vehicle(numWheels,maxSpeed){
  this.numWheels = numWheels;
  this.maxSpeed = maxSpeed;
}

瀵規鎴戜滑鎯寵瀹氫箟涓涓簿紜殑瀹炰緥鏉ヨ〃鐜頒竴涓箻瀹㈠垪杞︺傚湪鎴戜滑鐨勫瓙綾諱腑鎴戜滑涔熸兂琛?/P>

鐜板杞︾殑鏁伴噺騫舵敮鎸佸鍔犳垨鍑忓皯鐨勬満鍒躲傚湪甯哥敤鐨凧avascript涓紝鎴戜滑鍙兘榪欐牱鍐欙細

var passTrain = new Vehicle(24,100);
passTrain.carriageCount = 12;
passTrain.addCarriage = function(){
  this.carriageCount++;
}
passTrain.removeCarriage=function(){
  this.carriageCount--;
}

榪欎負鎴戜滑鐨凱assTrain瀵硅薄鎻愪緵闇瑕佺殑鍔熻兘鎬с備粠璁捐鐨勮鍥劇殑鏌ョ湅榪欎簺浠g爜錛岃櫧鐒跺畠

鏈夌偣鎺╅グ浜嗘墿灞曟墿灞曟у姛鑳芥у埌涓涓繛璐殑鍗曞厓銆侾rototyp鍙互鍦ㄨ繖閲屽府鍔╂垜浠紝閫?/P>

榪囧厑璁告垜浠畾涔夋墿灞曡涓轟綔涓轟竴涓璞″茍涓旀帴鐫浣跨敤瀹冩墿灞曞熀紜瀵硅薄銆傞鍏堬紝鎴戜滑浣?/P>

涓轟竴涓璞″畾涔夋墿灞曠殑鍔熻兘鎬э細

function CarriagePuller(carriageCount){
  this.carriageCount = carriageCount;
  this.addCarriage=function(){
    this.carriageCount++;
  }
  this.removeCarriage=function(){
   this.carriageCount--;
 }
}

鎺ョ潃鎴戜滑鍚堝茍榪欎袱涓潵鏀寔涓涓璞″寘鍚墍鏈夌殑闇瑕佺殑琛屼負錛?BR>var parent = new Vehicle(24,100);
var extension = new CarriagePuller(12);
var passTrain = Object.extend(parent,extension);

娉ㄦ剰鎴戜滑鍒嗗埆鍦ㄥ紑濮嬪悗鏉ュ畾涔夌埗鍜屾墿灞曞璞★紝鎺ョ潃灝嗕粬浠繘琛屾販鍚堛傝繖鐖跺瓙鍏崇郴瀛樺湪

榪欎簺渚嬩腑錛屼笉鍦╒ehicle鍜孋arriagePuller綾諱腑銆傚綋瀹冧笉鏄紜殑緇忓吀鐨勯潰鍚戝璞★紝瀹?/P>

鍏佽鎴戜滑淇濇寔鎴戜滑浠g爜涓庣郴緇熷姛鑳借繘琛屽叧鑱旓紝鍦ㄨ繖涓媺杞︽寜渚嬩腑錛屽湪涓涓湴鏂癸紝閫氳繃

鍦ㄦ垜浠洿瀹規槗榪涜澶嶇敤銆傛垜浠仛榪欎釜渚嬪瓙鐪嬭搗鏉ヤ技涔庢病鏈変粈涔堢敤澶勶紝鍦ㄥぇ鐨勯」鐩腑錛?/P>

鐢ㄨ繖縐嶆柟娉曞皝瑁呭姛鑳芥ф槸闈炲父鏈夌敤鐨勩?/P>

Prototype涔熶互AJax瀵硅薄鐨勬柟寮忔彁渚涘Ajax鏀寔錛岃繖鍙互瑙e喅瓚呭鉤鍙癤MLHttpRequest瀵?/P>

璞°侫jax鏄Ajax.Request綾誨瀷鎵╁睍錛屽畠鍙互浣跨敤XMLHttpRequest鍚戞湇鍔″櫒鍙戦佽姹?/P>

錛屼緥濡傦細 var req = new Ajax.Request('myData.xml');

榪欎釜鏋勯犲瓙浣跨敤涓涓垜浠篃灝嗚鐪嬪埌鐨勫湪寰堝Prototype-based綾誨簱涓殑鏍峰紡銆傚畠浣跨敤

緇撳悎鐨勬暟緇勬潵浣滀負涓涓彲閫夌殑鍙傛暟錛屽厑璁鎬竴涓鑼冨洿鐨勬寜鐓ч渶瑕佽繘琛岄厤緗?/P>

Ajax.Updater


The View in an Ajax application
Keepling the logic out of the View 灝哣iew鍒嗙鍑簂ogic
闂存帴浣跨敤CSS澧炲姞浜嬩歡
緇戝畾浜嬩歡鎺у埗浠g爜


The Rico framework has a concept of Behavior objects that target specific

sections of a DOM tree and add interactivity to them.

Keeping the view out of logic

 



]]>
主站蜘蛛池模板: 免费国产黄网站在线观看可以下载 | 免费毛片在线看不用播放器| 又黄又爽一线毛片免费观看| 亚洲国产精品ⅴa在线观看| 国产1024精品视频专区免费| 日本亚洲精品色婷婷在线影院| 91嫩草国产在线观看免费| 亚洲人色大成年网站在线观看| 国产成人精品久久免费动漫| 亚洲成人黄色在线| 成年人在线免费看视频| 亚洲国产欧美一区二区三区| 免费a级毛片18以上观看精品| 免费一级毛suv好看的国产网站 | 特级做A爰片毛片免费看无码| 亚洲国产精品一区二区成人片国内 | 亚洲综合一区无码精品| 免费爱爱的视频太爽了| 免费一级毛suv好看的国产网站| 久久久久亚洲爆乳少妇无| 免费人成黄页在线观看日本| 亚洲明星合成图综合区在线| 日本一区二区三区日本免费| 欧洲美女大片免费播放器视频| 久久亚洲国产精品一区二区| 日本在线高清免费爱做网站| 亚洲AV综合色区无码一二三区| 亚洲午夜激情视频| 99re免费99re在线视频手机版| 亚洲乱码中文字幕在线| 亚洲中文字幕第一页在线| 8x8×在线永久免费视频| 亚洲精品国产高清在线观看| 亚洲无码高清在线观看| 24小时免费看片| 国产精品亚洲综合天堂夜夜| 亚洲乱亚洲乱妇无码麻豆| 一二三四免费观看在线视频中文版| 美女裸免费观看网站| 亚洲精品视频观看| 亚洲国产精品一区二区九九 |