// make AJAX call to get contents and display in DIV1 and DIV2
function ajaxRequest(div_id1, div_id2, request_url, request_params) {
$("#" + div_id1).html('<img src="images/loading.gif" alt="Loading" title="Loading"/>');
$.ajax({
type: "POST",
dataType: "html",
url: request_url,
data: request_params,
success: function (response) {
$("#" + div_id1).html('<br>' + response.substring(0, 1);
$("#" + div_id2).html(response.substring(1, 2);
},
error: function (req, errorMsg) {}
})
}
你忘了再添加 1 个右括号
$("#" + div_id1).html('<br>' + response.substring(0, 1));
$("#" + div_id2).html(response.substring(1, 2));
你有一些错别字:
$("#" + div_id1).html('<br>' + response.substring(0, 1));
$("#" + div_id2).html(response.substring(1, 2));
添加)
关闭.html()
。
html()
后缺少右括号
success: function (response) {
$("#" + div_id1).html('<br>' + response.substring(0, 1));
// ^^
$("#" + div_id2).html(response.substring(1, 2));
// ^^
},