Ajax最小示例

var data = {
    tableId: 25,
    State: 1,
    bcId: 124356560303886909015737447882,
    curstart: 3,
    tableName: 'TABLE25',
    viewtitleName: 'COLUMN167',
    viewsubTitleName: ['COLUMN821', 'COLUMN166', 'COLUMN170'],
    tableView: '%E5%9B%BD%E4%BA%A7%E8%8D%AF%E5%93%81'
}
var formData = '';
var request = new XMLHttpRequest();
request.open("POST", "search.jsp", false);
request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
for (let x in data) {
    formData += `${x}=${data[x]}&`
}
request.send(formData);
console.log(request.responseText);
添加新评论