跳到内容

'); mywindow.document.write(data); mywindow.document.write(''); mywindow.print(); mywindow.close(); return true; } function getQueryVariable(variable) { var query = window.location.search.substring(1); var vars = query.split('&'); for (var i = 0; i < vars.length; i++) { var pair = vars[i].split('='); if (decodeURIComponent(pair[0]) == variable) { return decodeURIComponent(pair[1]); } } console.log('Query variable %s not found', variable); } $(document).ready(function () { var n = window.location.href.indexOf("&link=true"); if (n > 0) { //alert("link"); getCourses("", "link"); } else { getCourses(); } var m = window.location.href.indexOf("&getModal=true"); if (m > 0) { var CourseId = getQueryVariable('CourseId'); var ClassSection = getQueryVariable('ClassSection'); var college = getQueryVariable('college'); var strmRAW = getQueryVariable('modalStrm'); // var strmArray = strmRAW.split(","); //var strm = strmArray[0]+"|"+classNumber; getModal(CourseId, ClassSection, college, strmRAW); } else { //getCourses(); } }); function getDistFromBottom() { var scrollPosition = window.pageYOffset; var windowSize = window.innerHeight; var bodyHeight = document.getElementById('searchResults').offsetHeight; return Math.max(bodyHeight - (scrollPosition + windowSize), 0); } var subjectFilters = subject.toString(); var collegeLocationFilters = collegeLocations.toString(); var sessionFilters = sessions.toString(); var unitSpan = units.toString(); var timeSpan = times.toString(); searchBar = document.getElementById("class-search-box").value; document.addEventListener('scroll', function () { distToBottom = getDistFromBottom(); console.log('scrolling', getDistFromBottom()); if (!pollingForData && distToBottom > 0 && distToBottom <= scrollPosition) { pollingForData = true; totalResultCount = document.getElementById("totalResults").innerHTML; if ((offset * 20) < (totalResultCount)) { //alert(totalResultCount); getCourses("scroll"); } } });