0

I am working on a live ticker which works fine but when I am reloading the page I am running into this error:

XMLHttpRequest cannot load https://liveticker.local/ajax/ajax-liveticker.php due to access control checks.

Is there anything I can do to prevent this? I am pretty new to ajax.

setInterval(function () {
 $.ajax({
  processData: false,
  contentType: false,
  data: ajaxSendData,
  dataType: "json",
  error: function (xhr, ajaxOptions, thrownError) {
   console.log(xhr.status);
   console.log(thrownError);
    },
  type: "POST",
  url: "ajax/ajax-liveticker.php"
 }).done(function (data) {
  $("#liveticker").html(data.html)
 });
}, 5000);
1
  • That's an error message you'd usually get when you have a CORS issue (stackoverflow.com/q/43517254/1427878), but I don't see how reloading the page should cause this. This needs more detail. What is the exact URL of the page you are running this code in? Commented Mar 28 at 14:06

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.