/*
author: liulf
function:
var __db_cpcj=vCpcj;
var __db_cp=vCp;
var vCp={"cppage":[
{"cpdh":"A01000101","page":"1","ca": "1309-36-0","mc":"Pyrite","ename":"Pyrite","bm":"Pyrite"},
{"cpdh":"A01000201"," page":"1","ca":"1309-36-0","mc":"Sulfur concentrate","ename":"Pyrite concentrate;Sulfur concentrate","bm":""},
{"cpdh":"A01000202","page":"1","ca":"1309-36-0","mc":"Sulfur Concentrate Powder","ename":
" Powdered pyrite concentrate;Pyrites concentrate,powder;Sulfur concentrate,powder","bm":"Sulfur concentrate"},
{"cpdh":"A02000101","page":"1","ca": "","mc":"Phosphorus ore","ename":"Phosphorus ore","bm":""},
{"cpdh":"A02000111","page":"2", "ca":"","mc":"Phosphorite grit","ename":"Phosphorite grit","bm":""},
{"cpdh":"A02000201","page": "2","ca":"","mc":"Phosphate rock powder","ename":"Phosphate rock powder","bm":""},
{"cpdh":"A03000101" ,"page":"2","ca":"12447-04-0","mc":"Boron ore","ename":"Ascharite;Boric ore","bm":"Boron ore" },
{"cpdh":"A04000101","page":"2","ca":"","mc":"Potassium feldspar","ename":"Potash feldspar;Potassium feldspars" ,"bm":""},
{"cpdh":"A04000201","page":"2","ca":"12003-63-3","mc":"feldspar powder", "ename":"Feldspar powder","bm":""},
{"cpdh":"A04000301","page":"2","ca":"","mc":"光Halite","ename":"Carnallite","bm":""}
]}
*/
function ObjSearch()
{
this.kw = '';
this.searchCpcj= function()
{
$(vCpcj).each(function(){
});
}
this.searchCp = function()
{
// var json = eval(vCp.cppage)
// for(var i=0; i
// {
// alert(json [i].cpdh " " json[i].page)
// break;
// }
$.each(vCp.cppage,function(index,content){
document. write('' content.cpdh '
');
});
}
}
How to traverse jsonc objects? In fact, the method is very simple.
var obj ={"name":"Feng Juan","password":"123456″,"department":"Technical Department","sex":"Female", "old":30};