从JavaScript文件跨域Ajax请求没有服务器端code帮助 [英] Cross domain ajax request from javascript file without help of server side code

查看:117
本文介绍了从JavaScript文件跨域Ajax请求没有服务器端code帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我消费random.org的服务,(我想从使用URL random.org网站中获得的数字)。我用ajax从我的JavaScript获取数据。因此,如何从我的域名进行跨域Ajax调用(避免权限错误)?我想没有服务器端code(断绝代理)的帮助下解决方案。例如code将是对我很大的帮助。

I am consuming service of random.org, (I want to get the numbers from random.org site using url). I am fetching data using ajax from my JavaScript. So how to make cross domain ajax call from my domain (and avoid permission error)? I want solution without help of server side code (sever proxy). Example code will be great help for me.

推荐答案

大厅random.org的货主提供的 JSONP API - 这是实现这一目标的唯一途径

Lobby the owner of random.org to provide a jsonp API - that's the only way to make this happen.

这篇关于从JavaScript文件跨域Ajax请求没有服务器端code帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆