我有一个连接到我网站后端的联系表单,表单提交得很好,但我没有收到服务器响应。它始终是“未定义的”。我担心可能是因为这个,但我希望你们中的一个更聪明的人可以帮助我找到解决方法,或者如果不是因为这个(注意:很可能),那么也许你可以告诉我我做错了什么。
//==========================================================
public function openForm():void {
//==========================================================
var sendForm:URLLoader = new URLLoader();
var newFile:FileReference = new FileReference();
var request:URLRequest = new URLRequest(urlString);
if (form1.planby.visible && form1.planby.upload.selected) {
newFile.addEventListener(HTTPStatusEvent.HTTP_STATUS, responseStatus);
newFile.upload(request, "attache[attachment]", false);
} else {
sendForm.addEventListener(HTTPStatusEvent.HTTP_STATUS, responseStatus);
sendForm.load(request);
}
}
//==========================================================
function responseStatus(e:HTTPStatusEvent):void {
//==========================================================
//e.status == "undefined" according to debugger
if (e.status == 200) {
openPage("success");
} else {
openPage("error");
}
}