views:

1102

answers:

6

I am using simple jQuery

$.get( .... );

Here instead of getting GET response I get OPTIONS.( checked in firebug Net)

Same code is working fine in Safari. Looks like some problem with Firefox.

Any workaround / solutions to fix this problem..

Thanks

Kurund

A: 

Hi

I'm getign the same but with $.load(); Did you find solution ?

Eugene
Nope :(. It looks like firefox fix for cross-domain
Kurund Jalmi
A: 

This is likely due to restrictions on Javascript doing cross-domain XMLHttpRequests. This is generally not allowed for security reasons. See the question referenced above, or a similar question I asked.

To solve this problem:

Hope that helps!

fitzgeraldsteele
+1  A: 

The OPTION request what you see is the preflighted request, you can read about that here:

It's because you're requesting a cross-domain XMLHttpRequest so the browser has to check whether your request is allowed on the remote server or not.

There are two solutions to solve the problem (as mentioned above):

  • implement the response for the OPTION request with the corresponding Access-Control-* headers
  • use JSONP instead of simple JSON
KARASZI István
A: 

KARASZI István's answer is accurate. I've also stumbled upon the same issue, here's my insights on it; http://engin.bzzzt.biz/2010/01/25/cross-domain-xhr-access-control-preflight/

Engin
A: 

I had the same issue, because in my head i had

<base href="http://local.develepment.url" />

which i changed to

<base href="http://&lt;?php echo $_SERVER['HTTP_HOST']?>/" />
Moak