欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

asp.net中js和jquery調用ashx的不同方法分享

 更新時間:2013年06月07日 11:21:31   作者:  
asp.net中js和jquery調用ashx的不同方法分享,需要的朋友可以參考一下
=============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%>';
                   }
                }
            })

相關文章

最新評論