let op = (function () {
  
  let content = document.getElementById('content'),
    page = document.getElementById('page'),
    pageNum = document.getElementById('pageNum'),
    numList = pageNum.getElementsByTagName('li'),
    pageInp = document.getElementById('numInp');
  
  let n = 1,
    total = 1,
    jsonData = null;
  
  const pageClickHandle = function pageClickHandle(e) {
    e = e || window.event;
    const target = e.target || e.srcElement;
    const tagName = target.tagName.toUpperCase();
    let value = target.firstChild.nodeValue;
    
    // 如果点的是那个input就直接返回，啥也不做
    if (tagName === 'INPUT') {
      return
    }
    
    // 如果点的是那四个伪装按钮span
    if (tagName === 'SPAN') {
      console.log('span');
    }
    
    // 如果点的是那几个页面按键
    if (tagName === 'LI') {
      value = Math.round(parseFloat(value));
      if (isNaN(value)) {
        n = 1;
      } else if (value > total) {
        n = total;
      } else if (value < 1) {
        n = 1;
      } else {
        n = value;
      }
  
      sendAJAX();
    }
    
    
    
  };
  
  const bindHTML = function bindHTML(data) {
    let str = '', i = 0;
    
    for (i = 0; i < data.length; i++) {
      str += `
        <li studentId="${data[i].id}">
          <span>${data[i].id}</span>
          <span>${data[i].name}</span>
          <span>${data[i].sex === 0 ? '女' : '男'}</span>
          <span>${data[i].score}</span>
        </li>
      `
    }
    // 表格内容的数据绑定
    content.innerHTML = str;
    
    str = '';
    for (i = 1; i <= total; i++) {
      if (i === n) {
        str += `<li class="bg">${i}</li>`;
        continue;
      }
      str += `<li>${i}</li>`
    }
    // 页码区的数据绑定
    pageNum.innerHTML = str;
    
    pageInp.value = n;
    
  };
  
  const bindEvent = function bindEvent() {
    // 这里的page对象是dom对象，是有映射关系的哦！！！
    page.addEventListener('click', pageClickHandle);
  };
  
  const sendAJAX = function sendAJAX() {
    ajax({
      url: '/getList?n=' + n,
      success: function (data) {
        if (data && data.code === 0) {
          total = data['total'];
          jsonData = data['data'];
          bindHTML(data['data']);
          bindEvent();
        }
      }
    })
  };
  
  
  const init = function init() {
    sendAJAX();
  };
  
  return {
    init: init
  }
})();

op.init();
@@ -697,28 +697,510 @@
     
-console.log('span');
+switch (value) %7B%0A        case 'FIRST': %7B%0A          n = 1;%0A          break;%0A        %7D%0A        case 'PREV': %7B%0A          if (n === 1) %7B%0A            // %E5%A6%82%E6%9E%9C%E6%98%AF%E7%AC%AC%E4%B8%80%E9%A1%B5%E4%BA%86%EF%BC%8C%E5%B0%B1%E4%B8%8D%E5%86%8D%E5%8F%91ajax%E8%AF%B7%E6%B1%82%E7%9B%B4%E6%8E%A5%E8%BF%94%E5%9B%9E%0A            return;%0A          %7D%0A          n--;%0A          break;%0A        %7D%0A        case 'NEXT': %7B%0A          if (n === total) %7B%0A            return;%0A          %7D%0A          n++;%0A          break;%0A        %7D%0A        case 'LAST': %7B%0A          n = total;%0A          break;%0A        %7D%0A        default: %7B%0A          n = 1;%0A        %7D%0A      %7D%0A      
 %0A   
@@ -1483,19 +1483,23 @@
     %7D%0A  
+  %7D
 %0A  
+%0A
     send
@@ -1510,24 +1510,8 @@
 ();%0A
-    %7D%0A    %0A    %0A
     

完成 页码区功能键