我正试图在html页面上打印来自JS的REST请求的响应,但是当我返回html页面上的字符串时未被替换。
<JS代码/strong>
function sendDELrequest() {
serviceID = $("#serviceID").val();
var myurl = "/api/microservice/"+serviceID;
$.ajax({
method: "DELETE",
url: myurl,
success: function (response) {
Resp(response);
},
});
}
function Resp(r) {
resp=open("response.html").read();
resp = resp.replace(/__RESPONSE_VALUE__/g, r.text);
document.location.href = '/response';
}