2007-09-17

ajax 跨域访问

关键字: 跨域访问
应用中希望提供一个通用的JS,可以被 其他网站引用。
当用户打开引用这段代码页面时候,这段js访问 服务,取回数据,并在页面显示数据。
这里碰到了一个 ajax跨域访问的问题。
就是 比如引用这段js的网站是www.sina.com。 js要访问www.google.com 取得数据。
大家有没有碰到类似的。给个建议。
评论
afcn0 2007-09-18
有呀,跨域script tag看,看看yahoo服务就是这么弄的,XHR跨域,ie当中加入信任中可以,ff3.0正在搞信任header确认的XHR对象,是w3c新标准,还是script tag比较好用呀
jonson 2007-09-18
Have been implement by absolute js.the method is get js code from the server as this :<script type="" src="www.sina.com/xx.jsp"></script>.
in the jsp file.u can get the data and create the js code in the server side .and then run at the cient end.
by this way.i do the job i want.

and the more method which can resolve this method that can been argued here.
campaign 2007-09-17
把www.google.com加入到可信任站点,我们的项目就是这么做得,但在ff下没有办法
letle 2007-09-17
可以通过做一个中间代理来解决ajax跨域的问题
yeaha 2007-09-17
提取数据移到服务器端做,ajax传给js处理
发表评论

提醒: 该博客已发表在公共论坛,博客所有留言会成为论坛回贴,留言请注意遵守论坛发贴规则

您还没有登录,请登录后发表评论

jonson
搜索本博客
博客分类
我的相册
Ab7edce1-aada-3efb-93cb-534f23a093c4-thumb
大竹海04
共 2 张
最近加入圈子
存档
最新评论