jsFiddle Ajax /echo/json 不适用于普通 JavaScript
我正在尝试在 jsFiddle 中使用纯 JavaScript 来运行 JSON Ajax 测试...
...但我得到的只是一个空对象“{}”?
您可以通过将 /1/ 添加到上述 URL 的末尾来查看替代版本 - 从该示例来看,它完全中断了。
我查看了API文档 http://doc.jsfiddle.net/use/echo.html 而且它并没有那么有帮助(无论如何对我来说)。
任何人都可以阐明这一点吗?
问候, 标记
I'm trying to use just plain JavaScript within jsFiddle to run a JSON Ajax test...
...but all I get back is an empty object '{}'?
You can see an alternative version by adding /1/ to the end of the above URL - and from that example it breaks completely.
I've looked at the API documentation http://doc.jsfiddle.net/use/echo.html and it's not that helpful (to me anyway).
Can anyone shed any light on this please.
Regards,
Mark
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
数据应采用 URL 格式
/echo/json/?json={"text":"some text","array":[1,2," Three"],"object":{"par1":"another text ","par2":[3,2,"one"],"par3":{}}}&delay=3
http://jsfiddle.net/zalun/qwYu9/7/
data should be in URL format
/echo/json/?json={"text":"some text","array":[1,2,"three"],"object":{"par1":"another text","par2":[3,2,"one"],"par3":{}}}&delay=3
http://jsfiddle.net/zalun/qwYu9/7/
您正在尝试查询与运行 javascript 的域不同的域。这是不可能的,因为它可能会带来安全风险,并且会在浏览器级别被阻止。
生成此错误:
如您所见,域不同于 jshell.net 和 jsfiddle.net
You are trying to query a domain different from the one the javascript is running in. That's not possible since it might pose a security risk and is blocked at the browser level.
This error was generated:
As you can see, domains differ from jshell.net and jsfiddle.net