HTML5阿贾克斯到不同的域? [英] HTML5 Ajax to a different domain?

查看:210
本文介绍了HTML5阿贾克斯到不同的域?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近碰到 http://chromeexperiments.com/ 。我发现一对夫妇的项目有那些颇耐人寻味:100文和twitterbrowse(我会发布链接到他们,但我还没有允许)。这些都工作得不错,我在Firefox 3.5的Ubuntu 9.04下。我觉得特别奇怪的事情是,这两个实验,似乎发出Ajax请求到其他域比上承载的那些(以twitter.com,更准确)。我曾尝试同样的事情,一个HTML5页面上(使用<!DOCTYPE HTML> ),但我不能让它的工作。

I recently came across http://chromeexperiments.com/. I found a couple of projects there that are quite intriguing: 100 Tweets and twitterbrowse (I'd post links to them but I'm not yet allowed). These both work fine for me in Firefox 3.5 under Ubuntu 9.04. The thing that I find particularly peculiar is the fact that these two "experiments" seem to issue Ajax requests to other domains than the ones they are hosted on (to twitter.com, more exactly). I have tried the same thing on an HTML5 page (using <!DOCTYPE html>), but I can't get it to work.

我使用MooTools的创建要求,但是这不应该是一个问题,它仍然是阿贾克斯,对吧?

I'm using MooTools to create the requests, but that shouldn't be a problem, it's still Ajax, right?

任何想法,这些网站是怎么做的呢?

Any idea how those sites are doing this?

推荐答案

看一看的 http://snook.ca/archives/javascript/cross%5Fdomain%5Faj/

我personnaly能够使用在个人项目中,我不得不接受来自不同的域的服务器Ajax响应的JSON的方法来做到这一点。

I personnaly was able to do this using the JSON method on a personal project where I had to receive ajax response from a different domain's server.

这篇关于HTML5阿贾克斯到不同的域?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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