location.reload()在移动设备中无法正常工作......
location.reload()在桌面浏览器上工作正常,但在移动浏览器上没有工作(android)...
我在Django工作选择的文件来自ajax选择的modelchoicefields查询集在window.location.reload()之后丢失。 everthing在台式机中运行良好,但在移动设备中运行不正常。
我应该更改或添加???
您可以看到添加图片的差异...... difference between desktop and mobile device working..
代码是一个标准的ajax调用,让Django动态选择与前一个选择相关的字段......
<script>
function prosecFunction() {
var response = '';
var selected = document.getElementById("id_proje").value;
console.log(selected);
$.ajax({
url : "demirbas_ariza_listesi/",
type : "GET",
dataType: "text",
data : {
'selected' : selected,
},
success: function() {
window.location.reload();
},
failure: function() {
alert("hata var....veri aktarılamadı...");
}
}); /* ajax kapa...*/
}
</script>
<script>
答案 0 :(得分:0)
尝试使用document.location.reload(true);
代替window.location.reload();
success: function(data){
document.location.reload(true);
}