+ -
当前位置:首页 → 问答吧 → AJAX报内存不够

AJAX报内存不够

时间:2011-08-17

来源:互联网

JScript code

function addWishing() {
            var WishingName = document.getElementById("ddlWishingId")
            WishingName.options[WishingName.selectedIndex].value
            var WishingContent = document.getElementById('txtWishingContent').value;
            if (WishingContent == "") {
                alert('愿望不能为空');
                return false;
            } else {
                WishingContent = document.getElementById('txtWishingContent').value;
            }
            var WishingToName = document.getElementById('txtWishingToName').value;
            var WishingUserName = document.getElementById('txtWishingUserName').value;
            if (WishingUserName == "") {
                alert('签名不能为空');
                return false;
            } else {
                WishingUserName = document.getElementById('txtWishingUserName').value;
            }
            if (document.getElementById('radio1').checked == true) {
                var WishingType = 1;
            } else {
                var WishingType = 2;
            }
            if (document.getElementById('rdoWishingState1').checked == true) {
                var rdoWishingState = 1;
                WishingPassword = "";
            } else {
                document.getElementById('rdoWishingState2').checked == true;
                var rdoWishingState = 2;
                var WishingPassword = document.getElementById('txtWishingPassword').value;
            }
            var result = WishingTree.addWishing(WishingName, WishingContent, WishingToName, WishingUserName, WishingType, rdoWishingState, WishingPassword).value;
            if (result > 0) {
                alert('祝福成功!');
                document.getElementById('b').style.display = 'none';
            } else {
                alert('祝福失败!');
                document.getElementById('b').style.display = 'none';
            }
        }


HTML code

<input type="button" onclick="addWishing()" value="提交" />



C# code

[AjaxPro.AjaxMethod]
    public int addWishing(string WishingName,string WishingContent,string WishingToName,string WishingUserName,int WishingType,int rdoWishingState,string WishingPassword)
    {
        DB_Wishing dbw = new DB_Wishing();
        dbw.WishingName = WishingName;
        dbw.WishingContent = WishingContent;
        dbw.WishingPassword = WishingPassword;
        dbw.WishingState = rdoWishingState;
        dbw.WishingToName = WishingToName;
        dbw.WishingType = WishingType;
        dbw.WishingUserName = WishingUserName;
        dbw.WishingX = "21";
        dbw.WishingY = "22";
        dbw.WishingTreeID = "1";
        int i = DB_WishingManager.addWishing(dbw);
        return i;
    }


if(typeof o == "object") {
for(var attr in o) {
if(typeof o[attr] != "function") {
v.push('"' + attr + '":' + AjaxPro.toJSON(o[attr]));
}
}
if(v.length>0) {
return "{" + v.join(",") + "}";
}
return "{}";
}
return o.toString();
为什么报内存不够呢?

作者: qiuchen1006   发布时间: 2011-08-17

是服务器报内存不够还是客户端?

不管是那边报,内存应该吃紧了

作者: showbo   发布时间: 2011-08-17

引用 1 楼 showbo 的回复:
是服务器报内存不够还是客户端?

不管是那边报,内存应该吃紧了

多加个参数就不行了.

作者: qiuchen1006   发布时间: 2011-08-17

没见你代码有提示内存吃紧啊?

是系统日志记录有还是什么。。。

作者: showbo   发布时间: 2011-08-17