gpt4 book ai didi

javascript - XMLHTTPRequest 未收到来自 LotusScript 代理的响应

转载 作者:行者123 更新时间:2023-12-01 01:35:58 25 4
gpt4 key购买 nike

我有一个 LotusScript 代理,末尾有以下代码

Set nam = session.Createname(respParty)
Print "Content-type: text/plain"
Print nam.Abbreviated

我有一个 JavaScript 按钮,其中在 Submit() 之前包含以下内容

    var noEmployees = document.getElementById('NoEmployees').value;
var stateName = document.getElementById('State').value;
var url = 'http://' + window.location.host + '/ebsprospects.nsf/GetResponsiblePerson?OpenAgent&NoEmployees=' + noEmployees + '&State=' + stateName;
var xhttp = new XMLHttpRequest();
xhttp.open("GET", url);

xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
}
};
alert (xhttp.responseText);
document.getElementById("ResponsibleParty").innerHTML = xhttp.responseText;

一切正常,除了返回空白值。

如果我输入网址:

http://[webaddress]/[dbname].nsf/GetResponsiblePerson?OpenAgent&NoEmployees=20&State=IL

进入浏览器,就像我将其传递到它返回的 JS 代码中一样:

    X Content-type: text/plain Susanne Anderson/CBS

我做错了什么?

我的 JS 代码顺序是否错误?

最佳答案

 var noEmployees = document.getElementById('NoEmployees').value;
var stateName = document.getElementById('State').value;
var url = 'http://' + window.location.host + '/ebsprospects.nsf/GetResponsiblePerson?OpenAgent&NoEmployees=' + noEmployees + '&State=' + stateName;
var xhttp = new XMLHttpRequest();
xhttp.open("GET", url);

xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
alert (xhttp.responseText);
document.getElementById("ResponsibleParty").innerHTML = xhttp.responseText;
}
};
xhttp.send();

希望这会有所帮助。

关于javascript - XMLHTTPRequest 未收到来自 LotusScript 代理的响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52821893/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com