Home › forums › Using CanvasJS › getJSON issue
This topic contains 7 replies, has 3 voices, and was last updated by Vishwas R 9 months, 1 week ago.
I’m in pain with a getJSON.
I tried to run this example at home… without success. blank page.
I serve it from my server, and serve the JSON myself… same issue, blank page.
I tried with this tuto, and it works perfectly, so the jquery is correctly running…
I apology for this probably stupid newbie question, but I’m going crazy, and I request for your help.
Thanks for this cool lib.
OK, going to be resolved : Seems to be an Access-Control-Allow-Origin.
… Access control resolved… but page still blank :’-(
What am I doing wrong ?
(cannot edit or delete my post, so I post again)
I try this Sunil tip, always blank.
For security reasons, browsers restrict cross-origin requests. Serving JSON file from local webserver and making an AJAX call to it or serving it from CORS enabled JSON hosting service like myjson.com should work fine. Please take a look at this jsfiddle.
Also can you please check the Browser Console if there are any errors. Also kindly create jsfiddle reproducing the issue so that we can look into it and help you out.
I assumed that my stuff to resolve the Access-Control-Allow-Origin message error bypass this issue, but I misunderstood.
It works, thanks a lot.
Have a nice day, Vishwas.
Thanks to the support guy for that suggestion, but it looks kind of like bit.ly-ing a URL, a two step process.
Is there any reason not to use something like this ? It’s a clean one step solution with as little as two additional lines of code, maybe 5 if you include the comments.
The PHP Bitcoin example which had the CORS problem worked immediately after I added this.
Thanks in advance!
Thanks for sharing the article, which would help others who are facing this issue. You can use the reverse proxy / spoofing mentioned in the article if it’s secure to use.
You must be logged in to reply to this topic.