str = "{MyData:[{id:'" + id + "',name:'" + name + "'}]}";
原文链接:https://www.f2er.com/js/57478.html//var json = eval('(' + str + ')');
var fso,tf;
try{
fso = new ActiveXObject("Scripting.FileSystemObject");
tf = fso.CreateTextFile("F:\BaiduYun\MyHtml\DB_USER.json",true);
tf.WriteLine(str);
}catch(err){
}finally{
tf.Close();
}
}
function funSearch() {
var fso,ts,s;
var ForReading = 1;
try{
fso = new ActiveXObject("Scripting.FileSystemObject");
ts = fso.OpenTextFile("F:\BaiduYun\MyHtml\DB_USER.json",ForReading);
s = ts.ReadLine();
var json = eval('(' + s + ')');
alert(json.MyData[0].id);
}catch(err){
}finally{
ts.Close();
}
}