标签:需要 opened 必须 use obj XML exec session ssi
在设置请求头的时候报这个Failed to execute ‘setRequestHeader‘ on ‘XMLHttpRequest‘: The object‘s state must be OPENED.,是由于需要先打开XMLHttpRequest
var xhr = new XMLHttpRequest(); //打开xhr xhr.open(‘GET‘,url ); //设置请求头,请求头的设置必须在xhr打开之后,并且在send之前 xhr.setRequestHeader(‘user-sessionid‘, sessionId);
Failed to execute 'setRequestHeader' on 'XMLHttpRequest': The object's state must be OPENED.
标签:需要 opened 必须 use obj XML exec session ssi
原文地址:http://www.cnblogs.com/heihei-haha/p/7879551.html