Pull in JSON data

后端 未结 3 1469
南笙
南笙 2021-01-24 07:22

I am trying to get an event calendar working from json data. I just want to highlight dates, and have a div update below the calendar with the event details when the user clicks

3条回答
  •  面向向阳花
    2021-01-24 07:58

    This error is coming because the request

     $.getJSON("https://raw.github.com/gist/1676157/15ce81851e57dfcecb985039e970a749585959de/my.json") 
    

    is not in same domain.So console.log() shows this error

      Origin http://fiddle.jshell.net is not allowed by Access-Control-Allow-Origin.
    

    Running $.getJSON('Same domain request') will cause no error.

    See the fiddle and see console error message. http://jsfiddle.net/PGmFv/10/

提交回复
热议问题