Skip to content

Instantly share code, notes, and snippets.

@miketaylr
Created December 22, 2014 19:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miketaylr/40c61784ce873794d663 to your computer and use it in GitHub Desktop.
Save miketaylr/40c61784ce873794d663 to your computer and use it in GitHub Desktop.
🐓 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