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

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

ajax輸出問題

ajax輸出問題

慕斯王 2018-12-20 15:15:30
<!-- index.html --><!DOCTYPE html><html><head>    <meta charset="utf-8">    <title>ajax</title>    <script type="text/javascript">        var xhr = new XMLHttpRequest()        xhr.onreadystatechange = function () {            if (xhr.readyStage == 4) {                if ((xhr.status >= 200 && xhr.status<300) || xhr.status == 304) {                    console.log(xhr.responseText)                }else{                    console.log('successful'+xhr.status)                }            }        }        xhr.open('get','./test.txt',true)        xhr.send(null)    </script></head><body></body></html>問題:為什么瀏覽器上無顯示錯誤,且test.txt文件也確實已經(jīng)被加載到瀏覽器端了,卻不能console.log輸出或者alert彈窗。注意:1.文件是放在www目錄下,且服務器也已經(jīng)開啟。2.test.rxt有數(shù)據(jù)。相關(guān)截圖:
查看完整描述

1 回答

?
達令說

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

if (xhr.readyStage == 4) {

改為

if (xhr.readyState == 4) {


查看完整回答
反對 回復 2019-01-24
  • 1 回答
  • 0 關(guān)注
  • 452 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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