Data Loading

Data Loading

BJW86BJW86 Posts: 30Questions: 11Answers: 0

Having some trouble getting data to load through ajax from this url.

I have very limited experience with datables, can anyone tell me why this is not loading?

http://live.datatables.net/qudepeqe/1/edit

Thanks,
Bruce

Answers

  • allanallan Posts: 63,531Questions: 1Answers: 10,474 Site admin

    Hi Bruce,

    If you pop open the console in your browser, it will show the reason as an error message:

    Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://testnewspage.herokuapp.com/News?_=1663754265279. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.

    Do you control the testnewspage.herokuapp.com server-side code? If so, you need to add suitable CORS headers to allow loading of the data from a remote domain. Alternatively, host the site that is loading that JSON under the same sub-domain.

    Allan

  • BJW86BJW86 Posts: 30Questions: 11Answers: 0

    Ah brilliant thanks Allan, I’ll give that a try

    Bruce

Sign In or Register to comment.