JS控制form表单提交时增加随机数参数,防止浏览器缓存,重复提交


/*生成随机url参数*/
function getRandomP(){
	return "_r=a&tmp="+ Math.round(Math.random()*100000);
}
//提交请求
$("#submitId").attr("disabled", true);
tipsWindown("提示","text:操作执行中...","250","40","true","","true","text");
theForm = $("#form1");
//请求URL
var nextUrl = "/xxxxx.action?"+getRandomP();
theForm.attr("action", nextUrl);
theForm.attr("onsubmit", '');
theForm.submit();


你可能感兴趣的:(JS控制form表单提交时增加随机数参数,防止浏览器缓存,重复提交)