私は現在、javascriptを使用するWebページを持っています。Ajaxを使用してDBに移動すると、responseTextは常に空になります。
フラグを作成してクエリを送信するjs
objAjaxUpdates.main_flag = "getNames";
objAjaxUpdates.SendQuery(query);
フローの次(URLはaspxファイルです)
this.SendQuery = function(data) {
this.Initialize();
if (this.req != null) {
//alert(data);
//alert(this.url + " " + this.main_flag);
this.req.open("POST", this.url);
this.req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
this.req.onreadystatechange = this.processData;
this.req.send(data);
}
}
次
this.processData = function() {
if (objAjaxUpdates.req.readyState == 4) {
if (objAjaxUpdates.req.status == 200) {
if (objAjaxUpdates.req.responseText == "") {
alert('No Return');
}
else {
...
どんな助けでもいただければ幸いです。