作者:阳光碎了围脖_182 | 来源:互联网 | 2022-06-11 10:24
=============js================
代码如下:
var xhr = new XMLHttpRequest();
xhr.open("get", 'Controls/gengCart.ashx?CartID=' + input + '&count=' + inp, true);
xhr.setRequestHeader("If-Modified-Since", "0");
xhr.Onreadystatechange= function () {
if (xhr.readyState == 4 && xhr.status == 200) {
var result = xhr.responseText;
var json = eval("(" + result + ")");
alert(js.name);
}
};
xhr.send(null);
============jquery=====================
代码如下:
$.post('Controls/Cart.ashx', { "productID":<%= GetID %>,"count":"1","userID":'<%= uid %>' }, function (data,statu) {
if (statu == 'success') {
if(data=="false"){
alert("请登录后再进行此操作");
}
else{
window.location="gwc.aspx?uid="+'<%= uid%>';
}
}
})