js中json的创建和调用
来源:互联网 发布:数字小姐是谁 知乎 编辑:程序博客网 时间:2024/05/22 03:35
var jn={
"search":{
"textValue":"1",
"object":{
"textValue":"1"
},
"type":{
"textValue":"1"
},
"id":{
"textValue":"1"
},
"query":{
"fatherid":"",
"relation":"",
"textValue":"1",
"id":{
"textValue":"1"
},
"name":{
"textValue":"1"
},
"filter":{
"relation":"",
"textValue":"1",
"operation":{
"textValue":"1"
},
"input":{
"textValue":"1",
}
},
"columns":{
"textValue":"1",
"column":{
"textValue":"1"
}
},
"storage":{
"textValue":"1",
"storetype":{
"textValue":"1"
},
"source":{
"textValue":"1"
}
}
},
"result":{
"textValue":"1",
"sort":{
"sortway":"",
"textValue":"1",
"sortitem":{
"textValue":"1",
"weight":""
}
},
"group":{
"textValue":"1",
"column":{
"textValue":"1"
}
},
"data":{
"textValue":"1",
"column":{
"textValue":"1"
}
},
"limit":{
"textValue":"1",
"offset":{
"textValue":"1"
},
"rows":{
"textValue":"1"
}
}
}
}
"search":{
"textValue":"1",
"object":{
"textValue":"1"
},
"type":{
"textValue":"1"
},
"id":{
"textValue":"1"
},
"query":{
"fatherid":"",
"relation":"",
"textValue":"1",
"id":{
"textValue":"1"
},
"name":{
"textValue":"1"
},
"filter":{
"relation":"",
"textValue":"1",
"operation":{
"textValue":"1"
},
"input":{
"textValue":"1",
}
},
"columns":{
"textValue":"1",
"column":{
"textValue":"1"
}
},
"storage":{
"textValue":"1",
"storetype":{
"textValue":"1"
},
"source":{
"textValue":"1"
}
}
},
"result":{
"textValue":"1",
"sort":{
"sortway":"",
"textValue":"1",
"sortitem":{
"textValue":"1",
"weight":""
}
},
"group":{
"textValue":"1",
"column":{
"textValue":"1"
}
},
"data":{
"textValue":"1",
"column":{
"textValue":"1"
}
},
"limit":{
"textValue":"1",
"offset":{
"textValue":"1"
},
"rows":{
"textValue":"1"
}
}
}
}
};
// 在这里时jn变量不是json对象,它只是一个普通的obj对象。
var str=JSON.stringify(jn);
// 在这里我们把jn的obj转成了json的字符串形式,
console.info(str);json=JSON.parse(str);
// 在这里我们把转好的json字符串变成json对象
console.info(json);
// 这个是能转成json的字符串形式。
var s="{\"dd\":{\"ss\":\"ww\",\"ee\":\"rr\"}}";
//将字符串变成json
json=JSON.parseJSON(json);
// 这个是能转成json的字符串形式。
var s='{"dd":{"ss":"ww","ee":"rr"}}';
//将字符串变成json
json=JSON.parseJSON(json); 报错,不能转为json,因为它不认识'。只认识"
0 0
- js中json的创建和调用
- js中json对象的创建和调用
- js中匿名函数的创建和调用方法分析
- 关于 spring3 和spring4 中返回json 以及调用 js 和对原项目的修改
- js中json对象不规律key的遍历实现和json对象length属性的调用
- js中json对象不规律key的遍历实现和json对象length属性的调用
- js中创建json对象
- java 中 json的创建和转换
- java 中 json的创建和转换
- 关于json和后台调用js的方法
- android 调用js 和js中调用android的实现
- 关于js中 json对象和json字符串的总结
- JS中JSON对象和JSON字符串的转换
- pb9中COM的创建和调用
- oracle中包的创建和调用
- BCB中DLL的创建和调用
- v8中js创建以及调用c++类的实现
- js中匿名函数的创建与调用方法分析
- 质因数分解
- 用android studio 生成javadoc
- 关于动态添加多个分类标题并支持切换界面
- MySQL实现序列(Sequence)效果
- 331. Verify Preorder Serialization of a Binary Tree(难)
- js中json的创建和调用
- mfc combo box控件的使用及探究
- 欢迎使用CSDN-markdown编辑器
- Zigbee低功耗—终端节点休眠实现
- LeetCode - 225. Implement Stack Using Queues
- 添物不花钱学JavaEE(基础篇)- Java
- 【刷题之路】丑数
- The action name cannot be the same as the action suffix [Action]遇到此有关问题的解决办法
- Scalaz(50)- scalaz-stream: 安全的无穷运算-running infinite stream freely