代码如下: function removeIcon(id){
var scope='{id:"'+id+'"}';
PigossMsg.confirm("<%=IU.get("Sure Delete Icon")%>",null,function yesHandler(){
AjaxUtil.request({
url : '/icon/deleteIcon.action',
params : {"bean.scope":scope},
success : function(responseText,statusCode){
var info=decode(responseText);
if(info.code==0) {
PigossMsg.alert(info.desc,"<%=IU.get("Success")%>",function() {
// 这段代码重新请求了地址,然后刷新页面了,应该怎么改
window.location.href=window.location.href;
});
}else {
PigossMsg.alert(info.desc);
}
},
failure : function(responseText,statusCode){
alert("erro!");
}
});
},function noHandler(){}); }
window.location.href=window.location.href;
这个代码刷新了页面,应该怎么改。
求救啊。。
var scope='{id:"'+id+'"}';
PigossMsg.confirm("<%=IU.get("Sure Delete Icon")%>",null,function yesHandler(){
AjaxUtil.request({
url : '/icon/deleteIcon.action',
params : {"bean.scope":scope},
success : function(responseText,statusCode){
var info=decode(responseText);
if(info.code==0) {
PigossMsg.alert(info.desc,"<%=IU.get("Success")%>",function() {
// 这段代码重新请求了地址,然后刷新页面了,应该怎么改
window.location.href=window.location.href;
});
}else {
PigossMsg.alert(info.desc);
}
},
failure : function(responseText,statusCode){
alert("erro!");
}
});
},function noHandler(){}); }
window.location.href=window.location.href;
这个代码刷新了页面,应该怎么改。
求救啊。。
解决方案 »
- 淘宝的合并卖家
- 帮忙解决一个struts action-mappings 的疑惑
- struts2参数一直不丢失,怎么办?
- 我的htm网页竟然也出现乱码,怎么回事?
- 关于SESSION的一些疑惑,请各位指点讨论
- 哪位高手能帮我看看这报的是什么错误
- 为何找不到javax.servlet.jsp?
- salesforce单点登录问题
- 在文件的下载后存在本地后,文件出现一连串的数字,如何在下载后去掉数字,例:文件是azxs01.zip,下载到本地变成57329847583579azxs01.zi
- 怎样读取一个文件中的数据,以TXT文件为例吧
- 关于折线图(JAVA)程序
- ECSIDE 导出EXCEL文件的简单问题,散分
这段删除掉嘿嘿
就是刷新页面的,你不想刷新,必须删掉啊。后台删掉了前台你通过js控制它隐藏就好了,应该别无他法了,至于window.location.reload()还是刷新页面的。
window.location.href=window.location.href;这个是刷新页面的代码,一码事归一码事。
请求是会请求的,刷新也还是会刷新的
//删除
function delDownloadAjax(id) {
var param = {
id : id
};
$.ajax( { //采用Ajax方法
type : "post", //post方式
dataType : "json", //返回数据类型是JSON数据格式
data : param, //传递给Action的参数是param
url : 'Download/Delete.action', //处理的Action名称
success : function(data) { //成功的处理函数
在这里-----------------------------------
$("#tb1").empty();把要刷新的地方清空
$("#tb1").wrapInner(“htmlstr”);在把这个地方包入新的数据
---------------------------------------我这里用的是jquery },
error : function(data) { //操作失败及无权限的处理函数
permission(data);
}
});
}
页面重载,肯定刷新了,需要用ajax向服务端发起请求,然后服务端返回json或者xml格式数据,js进行解析,拼装到前台进行展示,才可以做到无刷新。
后台删除后重新查询DB中的数据 返回回去
用dom 删除原有数据 重新加载数据 可行否?