HTML或者JSP页面--执行完某事件后刷新页面,重置表单,清空数据

在提交表单或者执行某个事件之后,如果需要重置表单(即清空表单里的数据)

可以执行下面代码来完成

方式一:

self.location.href="userController.do?goAddOrUpdate";(双引号里面填写当前页面URL)

方式二:(去掉href)

self.location="userController.do?goAddOrUpdate";

方式三:(把上面的self改成this)

this.location="userController.do?goAddOrUpdate";

this.location.href="userController.do?goAddOrUpdate";

方式四:(放大招,通过reload方法)

this.location.reload();

self.location.reload();
原文地址:https://www.cnblogs.com/jpfss/p/10287540.html