﻿var xmlHttp = false;
try { xmlHttp = new ActiveXObject("MSXML2.XMLHTTP"); }
catch (e) {
    try { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); }
    catch (e2) {
        try { xmlHttp = new XMLHttpRequest(); }
        catch (e3) { xmlHttp = false; }
    }
}
if (!xmlHttp) alert("Error initializing XMLHttpRequest!");

//about.aspx
window.onload = function conn() {
    var url = "/cc/Styles/index.ashx";
    url = url + "?op=1";
    url = url + "&nn=a"; // +obj.cells[1].innerText; //+ obj.getElementById("t1").innerText;
    xmlHttp.open("GET", url, true);
    xmlHttp.onreadystatechange = updataconn; //updataPage
    xmlHttp.send(null);
}
function updataconn() {
    if (xmlHttp.readyState == 4) {
        if (xmlHttp.status == 200) {
            var response = xmlHttp.responseText;
            document.getElementById("tx1").value = response;
            if (response != "数据库连接成功。")
                document.getElementById("tx1").style.color = '#FF0000';
        }
        else
            alert("Error: status code is " + xmlHttp.status);
    }
}
