Bug Tracker

Modify

Ticket #2356 (closed bug: invalid)

Opened 5 years ago

Last modified 5 years ago

jquery.ajax() doesn't sends X-Requested-With headers if the dataType option is setted

Reported by: charlesschaefer Owned by:
Priority: major Milestone: 1.2.4
Component: ajax Version: 1.2.3
Keywords: Cc:
Blocking: Blocked by:

Description

When calling $.ajax() with the dataType setted (I've tested with json and script types), the X-Requested-With header isn't sent to the server.

I don't know if this is really a bug or a feature, so, if it's a feature, sorry.

Change History

comment:1 Changed 5 years ago by flesler

That only seems to happen if the requested url belongs to a remote domain, and the dataType is 'script'. In that case, a script element is used, so no chance of headers. Also, it seems Firefox 3 might throw an error when doing a cross domain request. What browser are you testing this on ? do you have a demo ?

comment:2 Changed 5 years ago by flesler

  • Status changed from new to closed
  • Resolution set to invalid

Script and json requests just can't have X-Requested-With (XMLHttpRequest) and adding that would be a lie :)

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.