function sendLogs(p,u){ getScrollTop = function(){ var scrollTop=0; if(document.documentElement&&document.documentElement.scrollTop){ scrollTop=document.documentElement.scrollTop; }else if(document.body){ scrollTop=document.body.scrollTop; } return scrollTop; }, ajax=function(param,uurl){ var xmlHttpReg = null; if (window.ActiveXObject) {//如果是IE xmlHttpReg = new ActiveXObject("Microsoft.XMLHTTP"); } else if (window.XMLHttpRequest) { xmlHttpReg = new XMLHttpRequest(); //实例化一个xmlHttpReg } if (xmlHttpReg != null) { xmlHttpReg.open("GET", uurl+"?"+param, true); xmlHttpReg.send(null); xmlHttpReg.onreadystatechange = doResult; //设置回调函数 } function doResult() { if (xmlHttpReg.readyState == 4) {//4代表执行完成 if (xmlHttpReg.status == 200) {//200代表执行成功 } } } }, postData = function(obj){ // 转成post需要的字符串. var str = ""; for(var prop in obj){ if(window.courselist && (prop == "chapterid")){ var lastcourse = null; for(var i = 0 ;i