JS code is as follows.
After invoking the Ajax return. A strange question. The returned resultstring value is "OK" but is not equal to the string "OK" comparison.
What parameters are added to the AJAX call Out.println ()?
The part of releasing the annotation is not filtered out.
Which expert has encountered a similar problem.
How to solve.
Please say it. Out.println (): What is the return?
JS Code
Copy Code code as follows:
Local Downloads
function Ftptest (IP, port, username, password, filedir) {
Alert ("Test");
Createxmlhttprequest ();
var url = "dataexportajaxservlet.doajax?osflg=ftptest&ip=" + IP + "&port=" + port;
Xmlhttp.open ("Get", url,true);
Xmlhttp.onreadystatechange = Gocallback;
Xmlhttp.send (NULL);
}
JS Code
Copy Code code as follows:
callback function
function Gocallback () {
if (xmlhttp.readystate = = 4) {
if (Xmlhttp.status = = 200) {
Results of implementation
var resultstring = Xmlhttp.responsetext;
alert (resultstring);
var newstrb = resultstring. replace ("\ r", "123");
Let's comment it out first.
Alert ("newstrb-" + NEWSTRB + "-");
if ("OK" = = NEWSTRB) {
Alert ("Success");
Document.getelementsbyname ("Buttonsave") [0].disabled = "";
}else{
Alert ("<bean:message key=" Ftptest.info.fail "/>");
document.getElementById ("ErrorMessage"). InnerHTML = ' Test unsuccessful ';
Document.getelementsbyname ("Buttonsave") [0].disabled = "true";
}
}
}
}