﻿// JScript 文件

//复杂方法，添加了很多检测，和错误处理
var xmlhttp,alerted
  try {
  xmlhttp=new ActiveXObject("Msxml2.XMLHTTP")
 } catch (e) {
  try {
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
  } catch (E) {
     //alert("请安装Microsofts XML parsers")
  }
 }
if (!xmlhttp && !alerted) {
 try {
  xmlhttp = new XMLHttpRequest();
 } catch (e) {
  //alert("你的浏览器不支持XMLHttpRequest对象，请升级");
 }
}
function getClock(productid)
{
if (xmlhttp) { 
  xmlhttp.Open("Get","/GetPrice.aspx?pid="+productid,true);
  xmlhttp.onreadystatechange=RSchange;  
  xmlhttp.send();
  }
}


function RSchange() 
{
  if (xmlhttp.readyState==4) {
  
  }
 }
 
 function getPrice(productid)
 {
 var Prid=productid;

 if (xmlhttp) { 
  xmlhttp.Open("Get","Http://192.168.1.250/GetPrice.aspx?pid="+productid,true);
  
  xmlhttp.send();
  
  }
  if (xmlhttp.readyState==4) 
  {

      Prid=xmlhttp.responseText;
  }
    document.write(Prid);
 }