ajax的open()報錯啦
var?request=new?XMLHttpRequest(); xmlHttp.open('POST','/api/admin/login'); xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); xmlHttp.send("name="+name+"&password="+password); xmlHttp.onreadystatechange=handleResult;
網頁報錯:Uncaught TypeError: Cannot read property 'open' of undefined
open里的url是絕對路徑,本地測試地址h3.com/api/admin/login是可以打開的,各位大神走過路過幫忙解答下,是路徑錯了嗎,那是咋的????找了一天都沒發(fā)現(xiàn)問題可郁悶了。
2017-11-26
用request.open