﻿var xmlHttp = false;
try 
{
  xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) 
{
  try 
  {
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  } 
  catch (e2) 
  {
    xmlHttp = false;
  }
}
if (!xmlHttp && typeof XMLHttpRequest != 'undefined') 
{
  xmlHttp = new XMLHttpRequest();
}
//检查账号是否注册
function Del_num(tid) 
{
      var url = "Ajaxadd.aspx?dtid=" + escape(tid)+"&date="+new Date();
      xmlHttp.open("GET", url, true);
      xmlHttp.onreadystatechange = updatePage;
      xmlHttp.send(null);
}
function updatePage() 
{
  if (xmlHttp.readyState < 4) 
  {
    
  }
  if (xmlHttp.readyState == 4) 
  {
    if (xmlHttp.status == 200) 
    {
        var response = xmlHttp.responseText;
        if(response=="0")
        {
           location.reload(); 
        }  
    }
  }
}
//输入数量，插入数据
function updatenumber(tid)
{
    var number=document.getElementById("input"+tid+"").value;
    var url = "Ajaxadd.aspx?tid=" + escape(number)+"&key="+escape(tid)+"&date="+new Date();
    xmlHttp.open("GET", url, true);
    xmlHttp.onreadystatechange = insert_check;
    xmlHttp.send(null);
}
function insert_check()
{
    if (xmlHttp.readyState < 4) 
    {
    
    }
    if (xmlHttp.readyState == 4) 
    {
        if (xmlHttp.status == 200) 
        {
             
        }
    }
}
