问题描述
我在控制台中收到此错误.我有一个脚本名称script.js,该脚本进行ajax调用以从php检索数据.
I'm getting this error in console. I have a script name script.js which makes ajax calls to retrieve data from php.
知道为什么吗?
这是我的jQuery脚本
Here's my jQuery script
$(document).ready(function() {
var loading = false;
var docHeight = $(window).height();
$('.timeline').css({minHeight: docHeight});
function get_tl_post() {
if (loading==false) {
loading = true;
$.ajax({
type:"POST",
url:"timeline.php",
data:"data=instagram",
beforeSend:function(){
$('.loader').fadeIn("slow");
},
complete:function(){
loading = false;
$('.loader').fadeOut("slow");
},
success:function(data) {
if(data=="error")
{
get_tl_post();
}
$(data).hide().appendTo(".timeline").fadeIn(1000);
}
});
}
}
$(window).scroll(function(){
if ($(window).scrollTop() == $(document).height() - $(window).height()) {
get_tl_post();
}
});
});
推荐答案
这是由于资源的网络映射所致.
换句话说,您可能在chrome开发工具中添加了工作区文件夹.现在,当您尝试对某些文件进行更改时,它会向文件系统发出请求.暂时可以正常工作.但是,在某些情况下,您将删除网络映射.
This is Due to Network Mapping of your resources.
In other words, you might have added workspace folder in your chrome dev tools.Now when you are trying to make changes in some files it makes the Request to the File-System. This works fine for a while. However in some scenarios you remove your network mapping.
然后,当您尝试在浏览器中打开该网页时,它可能会或可能不会要求重新映射网络资源,并且仍然尝试更新文件系统.那就是您收到此错误的时间.您的脚本没有错.
Then when you trying to open that web page on the browser, it might or might not ask for remapping of network resources and still try to update the File System.And that's when you get this error.There is nothing wrong with your script.
现在唯一的解决方法是删除高速缓存,然后重新启动System.如果问题仍然存在,则只需重新安装chrome,即可解决此问题.
Now the only solution to this could be Removing cache, then restarting System.If the problem still persist, you can simply re install chrome and this should be fixed.
此外,有时网络映射也可能导致其他一些问题.例如,使CSS文件大小达到75MB或更高.因此,在使用网络映射时必须采取预防措施.
Moreover, sometimes network mapping can cause several other issues as well.For example, making the CSS file size to whooping 75MB or above. So you have to take precautions when playing with network mapping.
sudo find / -type f -size +50000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
在您的终端中单击它,以找出超过50MB的罪魁祸首个人文件.然后可以将其删除.
Hit this in your Terminal to find out the culprit individual file which is over 50MB. you could then remove them.
这篇关于无法清除临时存储的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!