第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

關(guān)于變量定義。

關(guān)于變量定義。

再去西藏 2015-11-06 13:57:26
//?AjaxRequest?object?constructor function?AjaxRequest()?{ ??//?Try?the?XMLHttpRequest?object?first ??if?(window.XMLHttpRequest)?{ ????try?{ ??????this.request?=?new?XMLHttpRequest(); ????}?catch(e)?{ ??????this.request?=?null; ????} ??//?Now?try?the?ActiveX?(IE)?version ??}?else?if?(window.ActiveXObject)?{ ????try?{ ??????this.request?=?new?ActiveXObject("Msxml2.XMLHTTP"); ????//?Try?the?older?ActiveX?object?for?older?versions?of?IE ????}?catch(e)?{ ??????try?{ ????????this.request?=?new?ActiveXObject("Microsoft.XMLHTTP"); ??????}?catch(e)?{ ????????this.request?=?null; ??????} ????} ??} ??//?If?the?request?creation?failed,?notify?the?user ??if?(this.request?==?null) ????alert("Ajax?error?creating?the?request.\n"?+?"Details:?"?+?e); } //?Send?an?Ajax?request?to?the?server AjaxRequest.prototype.send?=?function(type,?url,?handler,?postDataType,?postData)?{ ??if?(this.request?!=?null)?{ ????//?Kill?the?previous?request ????this.request.abort(); ????//?Tack?on?a?dummy?parameter?to?override?browser?caching ????url?+=?"?dummy="?+?new?Date().getTime(); ????try?{ ??????this.request.onreadystatechange?=?handler; ??????this.request.open(type,?url,?true);?//?always?asynchronous?(true) ??????if?(type.toLowerCase()?==?"get")?{ ????????//?Send?a?GET?request;?no?data?involved ????????this.request.send(null); ??????}?else?{ ????????//?Send?a?POST?request;?the?last?argument?is?data ????????this.request.setRequestHeader("Content-Type",?postDataType); ????????this.request.send(postData); ??????} ????}?catch(e)?{ ??????alert("Ajax?error?communicating?with?the?server.\n"?+?"Details:?"?+?e); ????} ??} } AjaxRequest.prototype.getReadyState?=?function()?{ ??return?this.request.readyState; } AjaxRequest.prototype.getStatus?=?function()?{ ??return?this.request.status; } AjaxRequest.prototype.getResponseText?=?function()?{ ??return?this.request.responseText; } AjaxRequest.prototype.getResponseXML?=?function()?{ ??return?this.request.responseXML; }這個例子中request 為什么不要用var 定義。
查看完整描述

1 回答

已采納
?
李曉健

TA貢獻1036條經(jīng)驗 獲得超461個贊

因為你這么寫是按照面向?qū)ο缶幊痰模@里的request 是AjaxRequest對象的一個屬性,而不是一個變量,所以不用var

查看完整回答
反對 回復 2015-11-06
  • 1 回答
  • 0 關(guān)注
  • 1508 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號