Bug Tracker

Modify

Ticket #12326 (closed bug: invalid)

Opened 10 months ago

Last modified 7 months ago

$.AJAX changed the post content if include "??" (2 Question mark)

Reported by: yehuicn@… Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.8.0
Keywords: Cc:
Blocking: Blocked by:

Description

Version: 1.7.1/1.8.0

            $.ajax({
                url: '/',
                dataType: 'json',
                data: '??',
                type: 'post',
                success: function(data){
                },
                error: function(XMLHttpRequest, textStatus, errorThrown){
                }
            });

Please note that the post data including ?? (2 Question marks). It seems jquery change ?? as "jQuery1710291590959013191_1345184415274" (I think it is a callback name) before post to server.
The ?? was replaced on 7981th line of jquery-1.8.0.js

more information :
browser : firefox 14.0.1
OS : win7(nothing is related to OS)

THANK YOU

Change History

comment:1 follow-up: ↓ 2 Changed 10 months ago by jaubourg

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

?? is used as the callback name placeholder in the data for jsonp requests. So, finding it, jQuery will "promote" your request as jsonp.

Two solutions here:

Last edited 10 months ago by jaubourg (previous) (diff)

comment:2 in reply to: ↑ 1 Changed 8 months ago by doherty@…

Replying to jaubourg:

We are setting the content type to "application/json; charset=utf-8" and the data is still being mangled:

    var form = new Object();
    form.p_id = '??';

    $.ajax({
        type: 'POST',
        url: ...,
        data: JSON.stringify( form ),
        processData: false,
        success: ...,
        error: ...,
        dataType: 'json',
        contentType: "application/json; charset=utf-8"
    });

comment:3 Changed 7 months ago by timmywil

#12878 is a duplicate of this ticket.

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.