JS fetch TypeError: Failed To Fetch

Whenever i tried to fetch it returned an error TypeError:failed to fetch others solution doesnt to work for me. Here's my code

fetch(url)
  .then((resp) => resp.json())
  .then((data) => {
     this.JSONData = data;
  })
  .then(() => {
     this.search()
  }) 
  .catch(error => {
     alert(error);
  });
漫思
原文地址:https://www.cnblogs.com/sexintercourse/p/14891573.html