English 中文(简体)
IE FF中的次主题活动
原标题:Sub-domain REST call work in FF not in IE

我有一个超文本页面,设计有boot锁,需要一个教育、科学和技术部更新信息数据库。 The javascript:

$.support.cors = true;

$.ajaxSetup ({
  // Disable caching of AJAX responses
  cache: false,
  async: false
});

$("#submitemail").click(function() {

$.getJSON( http://sub.mydomain.com/getinfo/ + 
                 encodeURIComponent($( #emailaddress ).val()), 
                 function(resp) {
                    //do something here
                  }); 
});

FF。

利用IE——如果我从我的台式上打开了html文档,则将用电线子Mdomain.com和耳光。 然而,如果我从www.mydomain.com上开放该网站,并援引这种方法,则无。 与Fiddler进行核对——国际电子计算中心甚至没有发出要求。

最佳回答

You can t call a subdomain from your main domain like this. It s a cross-domain request, and the request will break. It should never work from www.mydomain.com -- even on FF. I don t know how it does.

不管怎样,你的服务器是如何建造的? Is the sub.mydomain.com 我的主.com/? 例如:

顶级领域:

www.un.org/Depts/DGACM/index_spanish.htm

次级领域

www.un.org/spanish/ga/president

?

如果档案结构类似,那么你可以允许查阅目录和使用。

url: /sub_domains/sub.mydomain.com/getinfo +whatever

Else, 您需要使用JSONP

。 JSONP或“有dding子的人”是对基础JSON数据格式的补充。 它提供了一种方法,要求服务器提供不同领域的数据,这是典型的网络浏览器由于Same血统政策而禁止的。

问题回答

暂无回答




相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签