Help with getting Json Format data from external website

后端 未结 4 1428
面向向阳花
面向向阳花 2021-01-23 13:59

I am trying to get Json format data from this website .. http://www.livetraffic.sg/feeds/json

however when i use ajax.. i run into this particular error in my chrome con

4条回答
  •  不思量自难忘°
    2021-01-23 14:41

    Simpler you can perform an ajax query to a local php page which contains

    header("Content-type: application/json; charset=utf-8");
    echo file_get_contents('http://www.livetraffic.sg/home2/get_erp_gantry');
    

    You just must have allow_url_fopen true.

提交回复
热议问题