ajax参考代码

$.ajax({
    url:'address_manager!yuyue.action',
    data:{'ampk':ampk,
    "productName":encodeURI($('#productName option:selected').text(), "utf-8"),
    "productpk":$('#productName').val(),
     "cartype":encodeURI($('#cartype').val(), "utf-8")},
    success:function(data) {
            layer.close(index);
            if("ok" ==data) {
            layer.msg("请求成功", {time: 2000});
           } else {
            layer.msg("请求失败",{time: 2000});
          }                         
        }
});

你可能感兴趣的:(ajax参考代码)