function checkVersion(url, ver) { /* var xmlHttpReq = false; var self = this; self.xmlHttpReq = new XMLHttpRequest(); self.xmlHttpReq.open('GET', url, true); self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); var requestTimer = setTimeout(function() { self.xmlHttpReq.abort(); }, 20000); clearTimeout(checkVersionTimer); var checkVersionTimer = null; self.xmlHttpReq.onreadystatechange = function() { if (self.xmlHttpReq.readyState == 4) { clearTimeout(requestTimer); if (self.xmlHttpReq.status != 200) { return; } serverver = parseInt(self.xmlHttpReq.responseText); if (serverver > ver) { self.xmlHttpReq.abort(); updateQuotes(url); } } } self.xmlHttpReq.send(); */ $.ajax({ url: url, cache: false, dataType: "text", success: function(serverver) { serverver = parseInt(serverver); if (serverver > ver) { updateQuotes(url); } }}); } function updateQuotes(url) { // $.ajax({ // url: url.replace(/\.ver$/, "-justquotes.html"), // cache: false, // dataType: "json", // success: function (data) { // window.version = data.ver; // document.getElementById("quotesarea").innerHTML = data.quotes; // resizeThisFrame(); // }}); window.location.reload(); } function checkItineraryVersion(url, ver) { $.get(url, function(data) { if (parseInt(data) > ver) { window.location.reload(); } }); }