<script>
if(window.history && window.history.pushState) {
$(window).on('popstate', function() {
var hashLocation = location.hash;
var hashSplit = hashLocation.split("#!/");
var hashName = hashSplit[1];
if(hashName !== '') {
var hash = window.location.hash;
if(hash === '') {
//这里写 要做的操作
var image = "";
$("input[name='image[]']").each(function(){
if($(this).val() != ''){
image += $(this).val()+",";
}
});
//删除图片操作
if(image != ''){
$.ajax({
type: "POST",
url: "{:U('Person/checkStatusBackDelete')}",
data: {'image':image},
success: function(res){
}
});
}
//跳转
window.location.href = "/Wechat/Person/my_robbing";
}
}
});
window.history.pushState('forward', null, './{$job.id}.html');
}
</script>
这儿 ./{$job.id}.html
指当前页面的后缀变量
网友评论