在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/HTML/ kindeditor 富文本編輯器怎么設(shè)置header頭信息?

kindeditor 富文本編輯器怎么設(shè)置header頭信息?

用kindeditor上傳圖片,怎么設(shè)置請(qǐng)求頭信息請(qǐng)輸入代碼function _ajax(url, fn, method, param, dataType) {

method = method || 'GET';
dataType = dataType || 'json';
var xhr = window.XMLHttpRequest ? new window.XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');

xhr.open(method, url, true);

xhr.onreadystatechange = function () {
    if (xhr.readyState == 4 && xhr.status == 200) {
        if (fn) {
            var data = _trim(xhr.responseText);
            if (dataType == 'json') {
                data = _json(data);
            }
            fn(data);
        }
    }
};
if (method == 'POST') {
    var params = [];
    _each(param, function(key, val) {
        params.push(encodeURIComponent(key) + '=' + encodeURIComponent(val));
    });
    try {
         xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');


    } catch (e) {

    };

} else {
    xhr.send(null);
}

}

xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
用這個(gè)他們默認(rèn)的設(shè)置,以及直接在header里面修改都是無(wú)效的,應(yīng)用怎么設(shè)置,有同學(xué)遇到過嗎?

回答
編輯回答
解夏

同問,也遇到這個(gè)問題!

2018年2月23日 19:11