$(function() { // outerHeight(true) 高度为 height+margin+padding+border var parameter = $(".section_2_html_root").data("page-params"); console.log("section_2:parameter", parameter); var sectionsHtmlArr = [ "section_2_class_all", "section_2_class_single", "section_2_level", "section_2_part", "section_2_lin_rank", "section_2_lin_score", "section_2_excellent" ]; $(".score_analysis_root").html(sectionsHtmlArr.map(function (htmlName) { return "
"; }).join("")); sectionsHtmlArr.forEach(function(htmlName) { if (htmlName === "preface") { $("." + htmlName + "_html_root").data("page-params", JSON.stringify({ htmlName: htmlName, subjectname: "语文", num: 12 })); } else if (htmlName === "section_1") { $("." + htmlName + "_html_root").data("page-params", JSON.stringify({ htmlName: htmlName, subjectname: "数学", num: 33 })); } $("." + htmlName + "_html_root").load("./sections/scoreAnalysis/" + htmlName + ".html"); }); });