PHP: Handling 'JSONP' output vs 'JSON', and its parsing?

后端 未结 3 815
遇见更好的自我
遇见更好的自我 2021-01-18 13:49

I am having a problem parsing \'jsonp\' request with php\'s json_decode function.

My questions is

a. What is the u

3条回答
  •  不思量自难忘°
    2021-01-18 14:13

    Not sure about it but i think names should also be quoted like this:

    domain_jsonp_callback({
       Categories:[
          {
             "Name":"Artifacts",
             "Position":14,
             "Count":70,
             "ImageUrls":{
                "i100":"//s3-eu-west-1.amazonaws.com/s.domain.com/1.png",
                "i120":"//s3-eu-west-1.amazonaws.com/s.domain.com/2.png",
                "i140":"//s3-eu-west-1.amazonaws.com/s.domain.com/3.png",
                "i180":"//s3-eu-west-1.amazonaws.com/s.domain.com/4.png",
                "i220":"//s3-eu-west-1.amazonaws.com/s.domain.com/5.png",
                "i280":"//s3-eu-west-1.amazonaws.com/s.domain.com/6.png"
             }
          }
       ]
    });
    

    PS: Probably "Categories" too :?

提交回复
热议问题