【正文】
or JavaScript Object Notation (JSON). The JavaScript technology may then use the content to update or modify the Document Object Model (DOM) of the HTML page. The term Asynchronous JavaScript Technology and XML (Ajax) has emerged recently to describe this interaction model. Ajax is not new. These techniques have been available to developers targeting Inter Explorer on the Windows platform for many years. Until recently, the technology was known as web remoting or remote scripting. Web developers have also used a bination of plugins, Java applets, and hidden frames to emulate this interaction model for some time. What has changed recently is the inclusion of support for the XMLHttpRequest object in the JavaScript runtimes of the mainstream browsers. The real magic is the result of the JavaScript technology39。 } The validate() function creates an XMLHttpRequest object and calls the open function on the object. The open function requires three arguments: the HTTP method, which is GET or POST。 (CacheControl, nocache)。 if (message == invalid) { = div style=\color:red\Invalid User Id/ div。s best to use libraries such as Dojo, which provides fallback solutions for making Ajax interactions transparently even on older browsers that do not support the XMLHttpRequest Object:. JavaScript technology implementations: Ajax interactions depend heavily on JavaScript technology, which has subtle differences depending on the client. See for more details on browserspecific differences. Consider using a library such as Dojo, which addresses many of the differences. Debugging: Ajax applications are also difficult to debug because the processing logic is embedded both in the client and on the server. Browser addons such as Mozilla Firebug have emerged to make debuging easier. Frameworks such as the Google Web Toolkit have emerged to allow for client and server roundtrip debugging. Securing resources and protecting your data: You can view clientside JavaScript technology simply by selecting View Source from an Ajaxenabled HTML page. A poorly designed Ajaxbased application could open itself up to hackers or plagiarism. When providing Ajax services, you should take care to make sure that those services are made available only to those intended. See Restricting Access to Your Ajax Services for more information on protecting your services. We have seen that Ajax interactions can solve many problems. Java technology provides a good base to develop and deploy Ajaxbased applications with APIs for tying in HTTP processing, databases, web services, XML processing, and business objects. With a better understanding of this interaction model, today39。s attributes。 } public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { String targetId = (id)。 } else if () { req = new ActiveXObject()。使用 AJAX還需要大量的客戶端 JavaScript技術(shù)和 CSS 。 其他選項,如 項目 jMaki 和 項目動態(tài)工作面 提供一種面向 Java開發(fā)人員能夠更好地利用 Ajax功能,而不需要深入了解的 JavaScript技術(shù)。 = font color=\red\ + message + /font。 (CacheControl, nocache)。 (duke,account data)。 執(zhí)行到 (null)的時候發(fā) 出請求。 創(chuàng)建和配置 一個 XMLHttpRequest對象 。 讓我們考慮一個例子。以前的傳統(tǒng)服務(wù)端 WEB應(yīng)用專注于為每一個客戶端的每一次請求生成 HTML頁面、每一次客戶端接到響應(yīng)都要刷新和重新渲染整個頁面。 畢業(yè)設(shè)計 (論文 )外文資料翻譯 學 院 : 計算機工程學院 專業(yè)班級 : ******** 學生姓名 : ***** 學 號: 110511606 指導(dǎo)教師 : **** 外文出處 : (外文 ) /technicalArticles 附 件 : ; 指導(dǎo)教師評語: 簽名: 年 月 日 異步 JavaScript技術(shù)和 XML ( AJAX )與 Java平臺 使用過 Flickr、 GMail,、 Google、 Suggest或 Google地圖的人都知道一種全新的動態(tài) WEB應(yīng)用正在成型、這些應(yīng)用看上去和傳統(tǒng)桌面應(yīng)用非常相似、他們不依賴于插件或者瀏覽器特效。而我們所談的 WEB應(yīng)用專注于客戶端把 HTML文檔當作模版或容器、客戶端向這個容器中插入內(nèi)容、作到這些的原理就是每當客戶端發(fā)生事件、客戶端都可以向服務(wù)端發(fā) 出請求并使用服務(wù)端返回的 XML數(shù)據(jù)。 一個 web應(yīng)用包含一個靜態(tài)的網(wǎng)頁, 或 HTML頁面中生成的 JSP技術(shù) 包含 HTML表單,需要服務(wù)器端的邏輯來驗證表單數(shù)據(jù)而無需刷新頁面。 var req。 如果一個 HTTP GET ,此內(nèi)容可能是 null 或空白。 } public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { String targetId = (id)。 ().write(invalid)。 } /script body div id=userIdMessage/div /body innerHTML屬性被改變以后網(wǎng)頁可以立即體現(xiàn)出變化、如果 innerHTML屬性內(nèi)部包含象 image、 iframe這樣的元素、那么其所指定的資源內(nèi)容一樣被瀏覽器解析顯示。 標準化 XMLHttpRequest對象: XMLHttpRequest對象是尚未加入的 JavaScript技術(shù)規(guī)范,這意味著行為可能會有所變化,這取決于客戶端。 作為應(yīng)用架構(gòu)師或開發(fā)人員,您將要權(quán)衡 這樣的 需要 具有豐富的應(yīng)用程序?qū)g覽器的支持,結(jié)構(gòu)復(fù)雜,技術(shù)和開發(fā)培訓。 } (GET, url, true)。 if ((targetId != null) amp。 modify the element39。s applications can bee more interactive, providing the end user with a better experience. Using Ajax requires that you use the latest browser versions that support the XMLHttpRequest object needed for Ajax interactions. Using Ajax also requires a great deal of clientside JavaScript technology and CSS. As an application architect or developer, you will need to weigh the needs of having a rich application against browser support, architecture plexity, and developer training. As the Ajax programming model evolves, existing technologies and frameworks will make this transition easier. What is evident is that prominent web applications are increasingly being more interactive. Are yours? 。 or add, remove, or modify child elements. One mon means to change the body content of an element is to set the innerHTML property on the element as in the following example. script type=text/javascript ... function setMessage(message) { var mdiv = (userIdMessage)。 !(())) { (text/xml)。 (null)。 什么是顯而易見的 事 ,著名的 Web應(yīng)用正日益成為 并 更具互動性。 見 瀏覽器的差別。 另外的改變