
function getCartNumber(){
var xmlhttp; 
try 
{ 
xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); 
} 
catch (e) 
{ 
try 
{ 
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); 
} 
catch (e) 
{ 
try 
{ 
xmlhttp=new XMLHttpRequest(); 
} 
catch (e) 
{ 
} 
} 
} 
xmlhttp.open("get","ajax_cartnum.php?ts=" + new Date().getTime()); 
xmlhttp.onreadystatechange=function() 
{ 
if(4==xmlhttp.readyState) 
{ 
if(200==xmlhttp.status) 
{ 
if (xmlhttp.responseText=="yes") 
{ 
msg=xmlhttp.responseText; //返回成功
} 
else 
{ 
msg=xmlhttp.responseText; //返回为false时候就是返回数量
} 
} 
else 
{ 
msg="error"; 
} 
var ch=document.getElementById("cart_count"); 
ch.innerHTML="<font color='#aaaaaa'>"+msg+"</font>"; 
} 
} 
xmlhttp.send(null); 
return false; 
} 

