Browse Source

不使用let, 使用var

wzl_h
wangzhonglu 2 years ago
parent
commit
d69e144fc2
7 changed files with 16 additions and 16 deletions
  1. 1
    1
      js/index.js
  2. 1
    1
      js/preface.js
  3. 1
    1
      js/section_1.js
  4. 1
    1
      js/section_2.js
  5. 5
    5
      js/section_3.js
  6. 5
    5
      js/section_4.js
  7. 2
    2
      librarys/utils/index.js

+ 1
- 1
js/index.js View File

1
 $(function () {
1
 $(function () {
2
-  let loadHtmlArr = [
2
+  var loadHtmlArr = [
3
     // "cover",
3
     // "cover",
4
     // // "catalog",
4
     // // "catalog",
5
     // "preface",
5
     // "preface",

+ 1
- 1
js/preface.js View File

1
 $(function() {
1
 $(function() {
2
   // outerHeight(true) 高度为 height+margin+padding+border
2
   // outerHeight(true) 高度为 height+margin+padding+border
3
-  let parameter = $(".preface_html_root").data("page-params");
3
+  var parameter = $(".preface_html_root").data("page-params");
4
   console.log("preface:parameter", parameter);
4
   console.log("preface:parameter", parameter);
5
 });
5
 });

+ 1
- 1
js/section_1.js View File

1
 $(function() {
1
 $(function() {
2
   // outerHeight(true) 高度为 height+margin+padding+border
2
   // outerHeight(true) 高度为 height+margin+padding+border
3
-  let parameter = $(".section_1_html_root").data("page-params");
3
+  var parameter = $(".section_1_html_root").data("page-params");
4
   console.log("section_1:parameter", parameter);
4
   console.log("section_1:parameter", parameter);
5
 });
5
 });

+ 1
- 1
js/section_2.js View File

1
 $(function() {
1
 $(function() {
2
   // outerHeight(true) 高度为 height+margin+padding+border
2
   // outerHeight(true) 高度为 height+margin+padding+border
3
-  let parameter = $(".section_2_html_root").data("page-params");
3
+  var parameter = $(".section_2_html_root").data("page-params");
4
   console.log("section_2:parameter", parameter);
4
   console.log("section_2:parameter", parameter);
5
 });
5
 });

+ 5
- 5
js/section_3.js View File

1
 function initSubjectBadEcharts() {
1
 function initSubjectBadEcharts() {
2
-  let xAxis_data = [
2
+  var xAxis_data = [
3
     "语文",
3
     "语文",
4
     "数学",
4
     "数学",
5
     "英语",
5
     "英语",
10
     "历史",
10
     "历史",
11
     "生物"
11
     "生物"
12
   ];
12
   ];
13
-  let series_data = [12, 20, 15, 8, 7, 11, 13,  15, 8];
14
-  let option = {
13
+  var series_data = [12, 20, 15, 8, 7, 11, 13,  15, 8];
14
+  var option = {
15
     animation: false,
15
     animation: false,
16
     title: {
16
     title: {
17
       text: "人",
17
       text: "人",
104
       },
104
       },
105
     ],
105
     ],
106
   };
106
   };
107
-  let myEcharts = echarts.init(document.querySelector(".section_3 #subjectBadEcharts"));
107
+  var myEcharts = echarts.init(document.querySelector(".section_3 #subjectBadEcharts"));
108
   myEcharts.clear();
108
   myEcharts.clear();
109
   myEcharts.setOption(option);
109
   myEcharts.setOption(option);
110
 }
110
 }
111
 $(function () {
111
 $(function () {
112
   // outerHeight(true) 高度为 height+margin+padding+border
112
   // outerHeight(true) 高度为 height+margin+padding+border
113
-  let parameter = $(".section_3_html_root").data("page-params");
113
+  var parameter = $(".section_3_html_root").data("page-params");
114
   console.log("section_3:parameter", parameter);
114
   console.log("section_3:parameter", parameter);
115
 
115
 
116
   initSubjectBadEcharts();
116
   initSubjectBadEcharts();

+ 5
- 5
js/section_4.js View File

1
 function initSubjectGoodEcharts() {
1
 function initSubjectGoodEcharts() {
2
-  let xAxis_data = [
2
+  var xAxis_data = [
3
     "语文",
3
     "语文",
4
     "数学",
4
     "数学",
5
     "英语",
5
     "英语",
10
     "历史",
10
     "历史",
11
     "生物"
11
     "生物"
12
   ];
12
   ];
13
-  let series_data = [12, 20, 15, 8, 7, 11, 13,  15, 8];
14
-  let option = {
13
+  var series_data = [12, 20, 15, 8, 7, 11, 13,  15, 8];
14
+  var option = {
15
     animation: false,
15
     animation: false,
16
     title: {
16
     title: {
17
       text: "人",
17
       text: "人",
104
       },
104
       },
105
     ],
105
     ],
106
   };
106
   };
107
-  let myEcharts = echarts.init(document.querySelector(".section_4 #subjectGoodEcharts"));
107
+  var myEcharts = echarts.init(document.querySelector(".section_4 #subjectGoodEcharts"));
108
   myEcharts.clear();
108
   myEcharts.clear();
109
   myEcharts.setOption(option);
109
   myEcharts.setOption(option);
110
 }
110
 }
111
 $(function() {
111
 $(function() {
112
   // outerHeight(true) 高度为 height+margin+padding+border
112
   // outerHeight(true) 高度为 height+margin+padding+border
113
-  let parameter = $(".section_4_html_root").data("page-params");
113
+  var parameter = $(".section_4_html_root").data("page-params");
114
   console.log("section_4:parameter", parameter);
114
   console.log("section_4:parameter", parameter);
115
 
115
 
116
   initSubjectGoodEcharts();
116
   initSubjectGoodEcharts();

+ 2
- 2
librarys/utils/index.js View File

1
 jQuery.extend({
1
 jQuery.extend({
2
   UnitUtil: (function() {
2
   UnitUtil: (function() {
3
-    let pxWidth = 0;
4
-    let tmpNode = document.createElement("DIV");
3
+    var pxWidth = 0;
4
+    var tmpNode = document.createElement("DIV");
5
     tmpNode.style.cssText =
5
     tmpNode.style.cssText =
6
       "width:1mm;position:absolute;left:0px;top:0px;z-index:99;visibility:hidden";
6
       "width:1mm;position:absolute;left:0px;top:0px;z-index:99;visibility:hidden";
7
     document.body.appendChild(tmpNode);
7
     document.body.appendChild(tmpNode);

Loading…
Cancel
Save