Yet another issue with my code. I'm trying to attach a function in the event of a successful request, but it doesn't seem to be working. My code so far:
const nbg = function() {
  $.ajax({
    url: "http://rmpc/json/notices.json",
    method: "GET",
    dataType: "json",
    cache: false,
    success: function (data) {
      alert("WORKS");
    }
  });
};
Yet, whenever I try success: alert("WORKS") it suddenly works.
I'm incredibly confused by this.
Any ideas?
Thanks
Edit: 'rmpc' is a local web server on my home network, might I add
 
     
    