﻿var xmhttp = false;
function createXMLHttpRequest() {
    if (window.XMLHttpRequest) { //Mozilla 浏览器
        xmhttp = new XMLHttpRequest();
        if (xmhttp.overrideMimeType) {//设置MiME类别
            xmhttp.overrideMimeType('text/xml');
        }
    }
    else if (window.ActiveXObject) { // IE浏览器
        try {
            xmhttp = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e) {
            try {
                xmhttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch (e) { }
        }
    }
    if (!xmhttp) { // 异常，创建对象实例失败
        window.alert("不能创建XMLHttpRequest对象实例.");
        return false;
    }

}
function send_request(url) {//初始化、指定处理函数、发送请求的函数
    //xmhttp = false;
    //开始初始化XMLHttpRequest对象
    createXMLHttpRequest();
    //xmhttp.onreadystatechange = processRequest;

    // 确定发送请求的方式和URL以及是否同步执行下段代码
    xmhttp.open("GET", url, true);
    xmhttp.send(null);


}
function ChapterCookieWrite(ChapterId,HttpUrl) {

    send_request('/ChapterCookie.aspx?id=' + Math.round(Math.random() * 100) + '&HttpUrl=' + HttpUrl + '&ChapterId=' + ChapterId);


}
