freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

網(wǎng)頁設(shè)計(jì)外文翻譯---使用xmlhttprequest對(duì)象-展示頁

2025-05-26 18:52本頁面
  

【正文】 options. As we discussed in Chapter 1, if you are going to use Ajax techniques, you need to either develop an alternative site or allow your application to degrade gracefully. With most usage statistics indicating that only a small fraction of browsers in use today lack XMLHttpRequest support, the chances of this being a problem are slim. However, you need to check your Web logs and determine what clients your customers are using to access your sites. Overview of the XMLHttpRequest Object You must first create an XMLHttpRequest object using JavaScript before you can use the object to send requests and process responses. Since XMLHttpRequest is not a W3C standard, you can use JavaScript in a couple of ways to create an instance of XMLHttpRequest. Inter Explorer implements XMLHttpRequest as an ActiveX object, and other browsers such as Firefox, Safari, and Opera implement it as a native JavaScript object. Because of these differences, the JavaScript code must contain logic to create an instance of XMLHttpRequest using the ActiveX technique or using the native JavaScript object technique. The previous statement might send shivers down the spines of those who remember the days when the implementation of JavaScript and the DOM varied widely among browsers. Fortunately, in this case you don’t need elaborate code to identify the browser type to know how to create an instance of the XMLHttpRequest object. All you need to do is check the browser’s support of ActiveX objects. If the browser supports ActiveX objects, then you create the XMLHttpRequest object using ActiveX. Otherwise, you create it using the native JavaScript object technique. If the call to , then the JavaScript branches to the elsestatement, which determines whether the browser implements XMLHttpRequest as a native JavaScript object. If , then an instance of XMLHttpRequest is created. Thanks to JavaScript’s dynamically typed nature and that XMLHttpRequest implementations are patible across various browsers, you can access the properties and methods of an instance of XMLHttpRequest identically, regardless of the method used to create the instance. This greatly simplifies the development process and keeps the JavaScript free of browserspecific logic. Methods and Properties Table 21 shows some typical methods on the XMLHttpRequest object. Don’t worry。 we’ll talk about these methods in greater detail in a moment. Table 21. Standard XMLHttpRequest Operations Method Description abort() The current request. getAllResponseHeaders() Returns all the response headers for the HTTP request as key/value pairs. getResponseHeader(header) Returns the string value of the specified header. open(method, url) Sets the stage for a call to the server. The method argument can be either GET, POST, or PUT. The url argument can be relative or absolute. This method includes three optional arguments. send(content) Sends the request to the server. setRequestHeader(header, value) Sets the specified header to the supplied value. open() must be called before attempting to set any headers. Let’s take a closer look at these methods. void open(string method, string url, boolean asynch, string username, string password): This method sets up your call to the server. This method is meant to be the scriptonly method of initializing a request. It has two required arguments and three optional arguments. You are required to supply the specific method you are invoki
點(diǎn)擊復(fù)制文檔內(nèi)容
畢業(yè)設(shè)計(jì)相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1