【发布时间】:2015-06-09 03:09:37
【问题描述】:
我使用 dropzone.js 上传文件。 这是我的代码
Dropzone.options.myDropzone = {
url: 'teacher.php?action=teacher_class_member_csv_form_confirm',
addRemoveLinks: true,
autoProcessQueue: false,
autoDiscover: false,
paramName: 'csv',
clickable: true,
accept: function(file, done) {
done();
},
error: function(file, msg){
alert(msg);
},
init: function() {
var myDropzone = this;
jQuery("#sbmtbtn").click(function(e) {
e.preventDefault();
e.stopPropagation();
// var queuedFiles = myDropzone.getQueuedFiles();
myDropzone.processQueue();
});
},
success: function(file, response) {
//jQuery("#myDropzone").submit();
//window.history.pushState({"html":response,"pageTitle":response.pageTitle},"", 'teacher.php');
document.write(response);
history.pushState(null, null, 'teacher.php');
}
};
当 ajax 进程完成时,它会响应一个模板。我正在使用document.write 来显示该模板。
但是当我在浏览器中单击返回按钮时,我无法转到上一页。
请帮助我。 对不起,如果我的英语不好。
【问题讨论】:
-
你的意思是说浏览器中的后退按钮吧?
-
是的,是浏览器的返回按钮
-
后退按钮不起作用,因为您在同一页面上书写,您没有导航到新页面以使后退按钮起作用
-
当我点击返回按钮时,url 改变但浏览器不刷新,它一直处于加载状态
标签: php dropzone.js