Opened 9 years ago
Closed 8 years ago
#15216 closed bug (migrated)
$.getJSON treats request as JSONP when URL contains ?? (two question marks)
Reported by: | Stijn | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | ajax | Version: | 2.1.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Similar to http://bugs.jquery.com/ticket/8417 and its duplicates, but they're all about the data parameter, not the URL parameter.
Happens with current stable and with edge. Fiddle: http://jsfiddle.net/r5zcw6wx/
Code:
$.getJSON("http://date.jsontest.com/") $.getJSON("http://date.jsontest.com/?foo") $.getJSON("http://date.jsontest.com/??foo")
Requests:
GET http://date.jsontest.com/ GET http://date.jsontest.com/?foo GET http://date.jsontest.com/jQuery2129957077760988448071399739372034175163514043816_1408610547781foo?_=1408610547782
Of course we shouldn't be making requests with two question marks (naive string concat on our side), and this could be a dupe of the mentioned ticket, but I figured this was worth reporting anyway.
Note: See
TracTickets for help on using
tickets.
Migrated to https://github.com/jquery/jquery/issues/1791