You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223242526272829
  1. $(function () {
  2. var loadHtmlArr = [
  3. // "cover",
  4. // "preface",
  5. // "section_1",
  6. "section_2",
  7. // "section_3",
  8. // "section_4",
  9. ];
  10. $(".pdf_root").html(loadHtmlArr.map(function (htmlName) {
  11. return "<div class='" + htmlName + "_html_root'></div>";
  12. }).join(""));
  13. loadHtmlArr.forEach(function(htmlName) {
  14. if (htmlName === "preface") {
  15. $("." + htmlName + "_html_root").data("page-params", JSON.stringify({
  16. htmlName: htmlName,
  17. subjectname: "语文",
  18. num: 12
  19. }));
  20. } else if (htmlName === "section_1") {
  21. $("." + htmlName + "_html_root").data("page-params", JSON.stringify({
  22. htmlName: htmlName,
  23. subjectname: "数学",
  24. num: 33
  25. }));
  26. }
  27. $("." + htmlName + "_html_root").load("../sections/" + htmlName + ".html");
  28. });
  29. });