Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
458 views
in Technique[技术] by (71.8m points)

javascript - Failed to clear temp storage

Failed to clear temp storage: It was determined that certain files are unsafe for access within a Web application, or that too many calls are being made on file resources. SecurityError

I'm getting this error in console. I have a script name script.js which makes ajax calls to retrieve data from php.

Any idea why?

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();
    }
  });
});
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.

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.

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.

Optionally if you are on Mac... or Even on Windows and have sh commands available.

sudo find / -type f -size +50000k -exec ls -lh {} ; | awk '{ print $9 ": " $5 }'

Hit this in your Terminal to find out the culprit individual file which is over 50MB. you could then remove them.

Note : What the above command does it, it will find all the individual files which are more than 50MB and print them on your terminal one by one.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...