Created
December 22, 2014 19:25
-
-
Save miketaylr/40c61784ce873794d663 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
🐓 curl http://www.mlxchange.com/Login/MLXWelcome.js | |
// Script code for Welcome page on WWW.MLXCHANGE.COM | |
// Global variables for XML documents | |
var xmlAppFeatures = null; | |
var xslSiteList = null; | |
function LoadXML() | |
{ | |
try | |
{ | |
//Check the user's browser first | |
var sBrowser = navigator.userAgent.toLowerCase(); | |
var bIsIE = false; | |
var reOtherBrowsers = new RegExp("konqueror|safari|omniweb|opera|webtv|icab|firefox|aol|msn|america", "g"); | |
// The user agent string returned by the above browsers will all contain MSIE. | |
// As a result, we want to filter them out first. | |
if (-1 == sBrowser.search(reOtherBrowsers)) | |
{ | |
// This might be IE. | |
idxBrowserName = sBrowser.indexOf("msie"); | |
if (-1 != idxBrowserName) | |
{ | |
bIsIE = true; | |
} | |
} | |
if (!bIsIE) | |
{ | |
document.location.href = "/Login/BrowserError.asp"; // Not IE | |
} | |
else | |
{ | |
xmlAppFeatures = new ActiveXObject("Microsoft.XMLDOM"); | |
xmlAppFeatures.async = true; | |
xmlAppFeatures.onreadystatechange = RenderSiteList; | |
xmlAppFeatures.load("/XMLData/MLSList.xml"); | |
xslSiteList = new ActiveXObject("Microsoft.XMLDOM"); | |
xslSiteList.async = true; | |
xslSiteList.onreadystatechange = RenderSiteList; | |
xslSiteList.load("/Login/WelcomeSiteCodeList.xsl"); | |
} | |
} | |
catch(e) | |
{ | |
alert("An error occurred loading MLXchange. Please retry and if the problem persists, contact the Help Desk."); | |
} | |
} | |
function RenderSiteList() | |
{ | |
try | |
{ | |
if (xmlAppFeatures != null && xmlAppFeatures.readyState == 4 && | |
xslSiteList != null && xslSiteList.readyState == 4) | |
{ | |
document.all.divListContain.innerHTML = xmlAppFeatures.transformNode(xslSiteList); | |
} | |
} | |
catch(e) | |
{ | |
alert("An error occurred loading MLXchange. Please retry and if the problem persists, contact the Help Desk."); | |
} | |
} | |
function LoadSite() | |
{ | |
try | |
{ | |
if (document.all.selMLSList.value != '') | |
{ | |
document.location.href = "http://" + document.all.selMLSList.value; | |
} | |
else | |
{ | |
alert('Please select your Site, then click Go.'); | |
} | |
} | |
catch(e) | |
{ | |
alert("An error occurred loading MLXchange. Please retry and if the problem persists, contact the Help Desk."); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment