Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] AJAX API accepts native
URL
and URLSearchParams
objects…
… as arguments The AJAX API (`@typo3/core/ajax/ajax-request`) has been enhanced to accept native URL-related objects, making usage of the API for developers a little bit easier. Resolves: #101970 Releases: main Change-Id: Ica7c8d5ded7184c5aad6355dbdfa5c4f1f82b0ce Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/81100 Tested-by: core-ci <typo3@b13.com> Tested-by: Benni Mack <benni@typo3.org> Tested-by: Garvin Hicking <gh@faktor-e.de> Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de> Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de> Reviewed-by: Garvin Hicking <gh@faktor-e.de> Reviewed-by: Benni Mack <benni@typo3.org>
- Loading branch information
1 parent
0cfadc5
commit e2416fa
Showing
5 changed files
with
53 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
.../Feature-101970-AJAXAPIAcceptsNativeURLAndURLSearchParamsObjectsAsArguments.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
.. include:: /Includes.rst.txt | ||
|
||
.. _feature-101970-1695205584: | ||
|
||
======================================================================================= | ||
Feature: #101970 - AJAX API accepts native URL and URLSearchParams objects as arguments | ||
======================================================================================= | ||
|
||
See :issue:`101970` | ||
|
||
Description | ||
=========== | ||
|
||
The AJAX API (:js:`@typo3/core/ajax/ajax-request`) has been enhanced to accept | ||
native URL-related objects. | ||
|
||
|
||
Impact | ||
====== | ||
|
||
The constructor now accepts a :js:`URL` object as argument, along with the | ||
already established `string` type. Also, the :js:`withQueryString()` method | ||
accepts an object of type :js:`URLSearchParams` as argument. | ||
|
||
Example | ||
------- | ||
|
||
.. code-block:: javascript | ||
import AjaxRequest from '@typo3/core/ajax/ajax-request.js'; | ||
const url = new URL('https://example.com/page/1/2/'); | ||
const queryArguments = new URLSearchParams({ | ||
foo: 'bar', | ||
baz: 'bencer' | ||
}); | ||
const request = new AjaxRequest(url).withQueryArguments(queryArguments); | ||
request.get().then(/* ... */); | ||
.. index:: JavaScript, ext:core |
2 changes: 1 addition & 1 deletion
2
typo3/sysext/core/Resources/Public/JavaScript/ajax/ajax-request.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.