Json access from different domain - clarification?

*(I already know that ajax calls has to be from the same origin , and already read the relevant [answers][1])* But I have a problem understanding something : Facebook (among others) use the `for(;;) || while(1)` thing in their json responses : ![enter image description here][2] And - obviously - if I want to use the data I have to remove the `for(;;)` string and then parse it myself. I was also told (by @esailija) that : > You can't remove the for loop unless you are from same origin that's the point Ok great - this is because of the same origin policy. **But** I ask this : Lets say John is doing this on his site (`john.com`): bla bla... bla bla... Notice its the **same** url as facebook's ( my left most red arrow) - **Assumption** * If he get the response via `...` and the response was without `for(;;)` , - he **still can't do nothing** with `{"__ar:1,....}` ! it will has to be padded (like jsonp) with `myCallBack({"__ar:1,....});` I mean : It's just like this : var a=1; {"__ar:1,....}

以上就是Json access from different domain - clarification?的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准