开发者

Safari complains: Origin file:// is not allowed by Access-Control-Allow-Origin

My JavaScript Ajax program works fine with FireFox. It even works OK on iPad!

But when I run it on Safari on Windows 7 - I get the above error. I am attaching the HttpRequest header and respond.

First the FF data- see below - I think - not sure - that it shows that the site I am accessing is not blocking me.

Next is the Safari data- see below - I think that the problem is that Safari adds to the request header a Origin:file://

I am not sure that this is the problem and I did not find a way to force Safari not to add it.

Thanks for your help Ori

Here is the FF Data

Response Headers

Date Thu, 04 Aug 2011 19:08:58 GMT Server Apache/2.2.3 (Linux/SUSE) Keep-Alive timeout=15, max=100 Connection Keep-Alive Transfer-Encoding chunked Content-Type text/html

Request Headers Host www.arabdictionary.huji.ac.il User-Agent Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.18) Gecko/20110614 BTRS35926 Firefox/3.6.18

Accept text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8

Accept-Language en-us,en;q=0.5

Accept-Encoding gzip,deflate

Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7

Keep-Alive 115

Connection keep-alive

Content-Type application/x-www-form-urlencoded; charset=UTF-8

Content-Length 50

Pragma no-cache

Cache-Control no-cache

Safari data

Request URL:http://www.arabdictionary.huji.ac.il/cgi-bin/arabic_results.pl

Request Headers开发者_C百科

Content-Type:application/x-www-form-urlencoded

DNT:1

Origin:file:// <<<<<<<<<<<<<<<<< I think that this is my problem <<<<<<<<<<<<<

User-Agent:Mozilla/5.0 (iPad; U; CPU OS 4_3_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5

Form Data

String:%d4%d4

searchType:byElement

act:dosearch

<<<<<<<<<<< No more data - no Response >>>>>>>>>>>>>>>>>>>>>

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜