【发布时间】:2020-03-31 14:17:36
【问题描述】:
是否可以像使用 Pug 或 EJS 一样从服务器端向客户端发送信息,但没有视图引擎?
现在我正在使用 XHTTP 请求来访问数据,但不必如此使用它会容易得多。
function getAllBears(id){
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("allBear").innerHTML = this.responseText;
}
};
xhttp.open("GET", "allBears", true);
xhttp.send();
}
【问题讨论】:
标签: javascript jquery html express