簡體   English   中英

XMLHTTPRequest沒有收到來自LotusScript代理的響應

[英]XMLHTTPRequest not receiving response from LotusScript agent

我有一個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();

希望這會有所幫助。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM