日期:2014-05-19 浏览次数:20801 次
<script>
function init(){
alert("xx");
}
</scipt>
<body onload="init()" >
</body>
//删除调用函数
function _delteData(){
$.ajax({
type:"post",
url:"删除提交URL",
data:{
//删除提交Id编号数据
},success:function(data){
alert("删除成功");
window.location.reload();
}
})
}
/**
* 商品的ajax
* @author Administrator
*/
@AjaxBean(name = "goodsAjax")
public class GoodsAjax extends AjaxSupport {
@MatchingBean
public GoodsService service;
/**
* 删除商品
* @param goodsId
* @return
*/
@AjaxMethod
public String delById(Long goodsId) {
try {
service.del(goodsId);
return "1;操作成功!";
} catch (Exception e) {
e.printStackTrace();
}
return "0;系统繁忙,请稍候重试!";
}
}
<script type="text/javascript" src="/flash/ajax/goodsAjax.js.svl"></script>
function doDel() {
confirmWin("询问", 300, 110, "您确定要删除这个商品吗?", "doDel1()");
}
function doDel1() {
setLoadGress("提交到服务器", "正在提交,请稍候...", 260, 60);
goodsAjax.delById(pageObj.list[objIndex].id, function(result) {
closeLoadGress();
var callback = (result.split(";")[0] == "1") ? "loadPage('" + pageObj.pageNo + "')" : "";
alertWin("提示", 260, 110, result.split(";")[1], result.split(";")[0], callback);
});
}