﻿function SendGetRequest(url)
{
    var xmlHttp = null;
    var status;

    try
    {
        xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch (e)
    {
        try
        {
            xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
        catch (e)
        {
            xmlHttp = false;
        }
    }

    if (!xmlHttp && typeof XMLHttpRequest != 'undefined')
    {
        xmlHttp = new XMLHttpRequest();
    }

    try
    {
        xmlHttp.open(
            "GET",
            url,
            false);

        xmlHttp.send();
        status = (xmlHttp.status == 200);
    }
    catch (e)
    {
        status = false;
    }

    if (!status)
    {
        throw ("Unable to send get request: '" + url + "'");
    }

    return xmlHttp.responseText;
}


