Home Forums Chart Support getJSON issue

getJSON issue

Viewing 8 posts - 1 through 8 (of 8 total)
  • #19932

    Hi there,
    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.

    Méric

    • This topic was modified 6 years, 8 months ago by Meric.
    #19935

    OK, going to be resolved : Seems to be an Access-Control-Allow-Origin.

    #19936

    … Access control resolved… but page still blank :’-(

    What am I doing wrong ?

    #19938

    (cannot edit or delete my post, so I post again)
    I try this Sunil tip, always blank.

    #19939

    @Meric,

    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.


    Vishwas R
    Team CanvasJS

    #19941

    Understood.
    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.

    Méric.

    • This reply was modified 6 years, 8 months ago by Meric.
    #22639

    Hey all,

    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!

    #22646

    @wonky,

    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.


    Vishwas R
    Team CanvasJS

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.