From 21a9eb3ff71ba23d0199e24ae007250e3fba66fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Wed, 22 Jul 2020 14:22:56 +0200 Subject: [PATCH 1/2] jQuery.ajax: Document special handling of a double question mark Fixes gh-999 Ref gh-1005 Co-authored-by: Dave Methvin --- entries/jQuery.ajax.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml index dfe7f3cc..cdb0b9f8 100644 --- a/entries/jQuery.ajax.xml +++ b/entries/jQuery.ajax.xml @@ -84,7 +84,11 @@ $.ajax({ - Data to be sent to the server. It is converted to a query string, if not already a string. It's appended to the url for GET-requests. See processData option to prevent this automatic processing. Object must be Key/Value pairs. If value is an Array, jQuery serializes multiple values with same key based on the value of the traditional setting (described below). + +

Data to be sent to the server. If the HTTP method is one that cannot have an entity body, such as GET, the data is appended to the URL.

+

When data is an object, jQuery generates the data string from the object's key/value pairs unless the processData option is set to false. For example, { a: "bc", d: "e,f" } is converted to the string "a=bc&d=e%2Cf". If the value is an array, jQuery serializes multiple values with same key based on the value of the traditional setting (described below). For example, { a: [1,2] } becomes the string "a%5B%5D=1&a%5B%5D=2" with the default traditional: false setting.

+

When data is passed as a string it should already be encoded using the correct encoding for contentType, which by default is application/x-www-form-urlencoded. If the string contains a double question mark (??) it is replaced with a value generated by jQuery that is unique for each copy of the library on the page (e.g. jQuery21406515378922229067_1479880736745).

+
From 493d13be7d7ffc42a4cf7668736cad5adf8ac4fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Mon, 24 Aug 2020 17:27:50 +0200 Subject: [PATCH 2/2] fixup! jQuery.ajax: Document special handling of a double question mark --- entries/jQuery.ajax.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml index cdb0b9f8..991e23ee 100644 --- a/entries/jQuery.ajax.xml +++ b/entries/jQuery.ajax.xml @@ -87,7 +87,8 @@ $.ajax({

Data to be sent to the server. If the HTTP method is one that cannot have an entity body, such as GET, the data is appended to the URL.

When data is an object, jQuery generates the data string from the object's key/value pairs unless the processData option is set to false. For example, { a: "bc", d: "e,f" } is converted to the string "a=bc&d=e%2Cf". If the value is an array, jQuery serializes multiple values with same key based on the value of the traditional setting (described below). For example, { a: [1,2] } becomes the string "a%5B%5D=1&a%5B%5D=2" with the default traditional: false setting.

-

When data is passed as a string it should already be encoded using the correct encoding for contentType, which by default is application/x-www-form-urlencoded. If the string contains a double question mark (??) it is replaced with a value generated by jQuery that is unique for each copy of the library on the page (e.g. jQuery21406515378922229067_1479880736745).

+

When data is passed as a string it should already be encoded using the correct encoding for contentType, which by default is application/x-www-form-urlencoded.

+

In requests with dataType: "json" or dataType: "jsonp", if the string contains a double question mark (??) anywhere in the URL or a single question mark (?) in the query string, it is replaced with a value generated by jQuery that is unique for each copy of the library on the page (e.g. jQuery21406515378922229067_1479880736745).