WEB开发网
开发学院网页设计JavaScript js解析json并生成html页面 阅读

js解析json并生成html页面

 2012-10-25 16:08:14 来源:WEB开发网   
核心提示:newW.document.write("var year = issueList[0].date.substring(0,4);");newW.document.write("var month;");newW.document.write("var y = docu
newW.document.write("var year = issueList[0].date.substring(0,4);");
newW.document.write("var month;");
newW.document.write("var y = document.getElementById(\"y\");");
newW.document.write("y.options.length = 0;");
newW.document.write("y.options.add(new Option(year,year));");
newW.document.write("var m = document.getElementById(\"m\");");
newW.document.write("m.options.length = 0;");
newW.document.write("var date;");
newW.document.write("var d = document.getElementById(\"d\");")
newW.document.write("d.options.length = 0;");
newW.document.write("for(var i=0;i<issueList.length;i++){");
newW.document.write("month = issueList[i].date.substring(4);");
newW.document.write("m.options[i] = new Option(month,month);");
newW.document.write("}");
newW.document.write("if(typeof issueList != \"undefined\" && issueList.length >0){");
newW.document.write("for(var i=0;i<issueList.length;i++){");
newW.document.write("var issues = issueList[0].issues;");
newW.document.write("for (var j =0; j< issues.length; j++){");
newW.document.write("date = issues[j].t.substring(6);");
newW.document.write("d.options[j] = new Option(date,date);");
newW.document.write("}}}}Dchange('ck');};")
//月下拉改变函数
newW.document.write("function Mchange (value){");
newW.document.write("var date;");
newW.document.write("var d = document.getElementById('d');");
newW.document.write("d.options.length = 0;");
newW.document.write("if(typeof issueList != \"undefined\" && issueList.length >0){");
newW.document.write("for(var i=0;i<issueList.length;i++){");
newW.document.write("if(value == issueList[i].date.substring(4)){ ");
newW.document.write("var issues = issueList[i].issues;");
newW.document.write("for (var j =0; j< issues.length; j++){");
newW.document.write("date = issues[j].t.substring(6);");
newW.document.write("d.options[j] = new Option(date,date);");
newW.document.write("}}}}};");

newW.document.write("function Dchange(value){temp(value);};");
newW.document.write("function openEdition(value) { temp(value);};");

newW.document.write("function temp(value) {");
newW.document.write("var date;");
newW.document.write("var y = document.getElementById('y').value;");
newW.document.write("var m = document.getElementById('m').value;");
newW.document.write("var d = document.getElementById('d').value;");
newW.document.write("date = y+m+d;");
newW.document.write("if(typeof issueList != \"undefined\" && issueList.length >0){");

上一页  1 2 3 4  下一页

Tags:js 解析 json

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接