1// document.addEventListener("DOMContentLoaded", function () { 2// //以ä¸åéç»ä¸ä½¿ç¨var,ç¦ç¨let,å ¼å®¹IE 3// var customerVisitUrl = "https://www.twfrenchfries.com/api/customerVisit/"; 4// var customerVisitData = {}; 5// var requestPostType = "POST"; 6 7// function ajax(method, url, data, success) { 8// var xhr = new XMLHttpRequest(); 9// xhr.open(method, url, true); 10// xhr.setRequestHeader("Content-Type", "application/json"); 11// xhr.onreadystatechange = function () { 12// if (xhr.readyState === 4) { 13// if (xhr.status === 200) { 14// success(xhr.responseText); 15// } else { 16// console.log("Error: " + xhr.status); 17// } 18// } 19// }; 20// xhr.send(data); 21// } 22 23// // è·åå½åç½é¡µçåè®®+åå 24// function getPageBaseUrl() { 25// var baseURL = ""; 26// if (!window.location.origin) { 27// // å ¼å®¹IEï¼IE11çæ¬ä¸location.origin为undefined 28// window.location.origin = 29// window.location.protocol + 30// "//" + 31// window.location.hostname + 32// (window.location.port ? ":" + window.location.port : ""); 33// } else { 34// baseURL = window.location.origin; 35// } 36// return baseURL; 37// } 38 39// if ( 40// navigator.userAgent.match(/Mobi/i) || 41// navigator.userAgent.match(/Android/i) || 42// navigator.userAgent.match(/iPhone/i) 43// ) { 44// customerVisitData.device_port = "2"; 45// } else { 46// customerVisitData.device_port = "1"; 47// } 48// customerVisitData.url = window.location.href; 49// customerVisitData.domain = getPageBaseUrl() + "/"; 50// customerVisitData.referrer_url = document.referrer; 51// ajax( 52// requestPostType, 53// customerVisitUrl, 54// JSON.stringify(customerVisitData), 55// function (data) {} 56// ); 57// }); 58(function () { 59 var customerVisitUrl = "https://www.twfrenchfries.com/api/customerVisit/"; 60 var customerVisitData = {}; 61 var requestPostType = "POST"; 62 63 function initVisit() { 64 function ajax(method, url, data, success) { 65 var xhr = new XMLHttpRequest(); 66 xhr.open(method, url, true); 67 xhr.setRequestHeader("Content-Type", "application/json"); 68 xhr.onreadystatechange = function () { 69 if (xhr.readyState === 4) { 70 if (xhr.status === 200) { 71 success(xhr.responseText); 72 } else { 73 console.log("Error: " + xhr.status); 74 } 75 } 76 }; 77 xhr.send(data); 78 } 79 80 function getPageBaseUrl() { 81 var baseURL = window.location.origin; 82 if (!baseURL) { 83 baseURL = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ":" + window.location.port : ""); 84 } 85 return baseURL; 86 } 87 88 if (navigator.userAgent.match(/Mobi/i) || navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/iPhone/i)) { 89 customerVisitData.device_port = "2"; 90 } else { 91 customerVisitData.device_port = "1"; 92 } 93 customerVisitData.url = window.location.href; 94 customerVisitData.domain = getPageBaseUrl() + "/"; 95 customerVisitData.referrer_url = document.referrer; 96 97 ajax(requestPostType, customerVisitUrl, JSON.stringify(customerVisitData), function (data) {}); 98 } 99 100 // --- å ³é®ä¿®å¤ä»£ç å¼å§ --- 101 if (document.readyState === "interactive" || document.readyState === "complete") { 102 // 妿已ç»å è½½å®æï¼ç´æ¥è¿è¡ 103 initVisit(); 104 } else { 105 // å¦åæ£å¸¸çå¬ 106 document.addEventListener("DOMContentLoaded", initVisit); 107 } 108 // --- å ³é®ä¿®å¤ä»£ç ç»æ --- 109})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.