您的位置:首页 > Web前端 > JavaScript

一些js

2015-06-30 22:40 821 查看
1.json对象的写法

var obj = {};
obj.SystemCode = code;
obj.pageIndex = pageIndex;


$.post(url, obj,function (result) {
);
});


传给后台的json数据是

{“SystemCode”:"code","pageIndex":“pageIndex”}


如果传入的见其值为空数据为

{“SystemCode”:null}的形式


//将字符串"null"或null转换为""
function checkNull(temp) {
if (temp == null)
temp= "";
if (temp.toString().toLowerCase() == "null")
temp = "";
return temp;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: