TuiKiken2010-09-27 15:00:27
TuiKiken, 2010-09-27 15:00:27

AJAX request in jQuery. How to get rid of Access-Control-Request-Headers header?

Hello. It is necessary with the help of javascript to extract data from an xml file generated on a remote server. All I could think of was to make an ajax request to the xml file.
But jQuery sends an OPTIONS request instead of a GET request.
It turned out that this request is sent by Firefox in the case of a cross-domain request, when non-standard headers are sent. In jQuery's case it seems like:
Access-Control-Request-Headers: x-requested-with

How to get rid of this header? Or maybe there are other ways to pull information from xml?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
kuzalex2, 2010-12-15

This is a cross domain AJAX security policy, like flash's crossdomain.xml, the remote server must allow it to be used. If this is possible, then here is the theory - metajack.im/2010/01/19/crossdomain-ajax-for-xmpp-http-binding-made-easy/ , here is the working method - blog.dgorbunov.ru/2009/05/jquery -mochiweb-options.html

metakey, 2010-09-27

You can configure nginx on the server native for the script so that it unloads remote xml on some request /getxml?params.

nikitammf, 2010-09-27

here is a small jquery plugin

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question