URLSearchParams and FormData on MS Edge

This is one of those “I couldn’t find the answer googling, so writing this post as a reminder to future me” sort of posts.
There’s a really neat feature of URLSearchParams that lets you construct it with a FormData object. It&rs…


This content originally appeared on Welcome to my blog on Trys Mudford and was authored by Welcome to my blog on Trys Mudford

This is one of those “I couldn’t find the answer googling, so writing this post as a reminder to future me” sort of posts. There’s a really neat feature of URLSearchParams that lets you construct it with a FormData object. It’s a lovely pattern for converting a form to a query string in a few lines. And allows you to append to the string safely. const formData = new FormData(searchForm); const searchParams = new URLSearchParams(formData); const queryString = searchParams.


This content originally appeared on Welcome to my blog on Trys Mudford and was authored by Welcome to my blog on Trys Mudford


Print Share Comment Cite Upload Translate Updates
APA

Welcome to my blog on Trys Mudford | Sciencx (2020-05-08T00:00:00+00:00) URLSearchParams and FormData on MS Edge. Retrieved from https://www.scien.cx/2020/05/08/urlsearchparams-and-formdata-on-ms-edge/

MLA
" » URLSearchParams and FormData on MS Edge." Welcome to my blog on Trys Mudford | Sciencx - Friday May 8, 2020, https://www.scien.cx/2020/05/08/urlsearchparams-and-formdata-on-ms-edge/
HARVARD
Welcome to my blog on Trys Mudford | Sciencx Friday May 8, 2020 » URLSearchParams and FormData on MS Edge., viewed ,<https://www.scien.cx/2020/05/08/urlsearchparams-and-formdata-on-ms-edge/>
VANCOUVER
Welcome to my blog on Trys Mudford | Sciencx - » URLSearchParams and FormData on MS Edge. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2020/05/08/urlsearchparams-and-formdata-on-ms-edge/
CHICAGO
" » URLSearchParams and FormData on MS Edge." Welcome to my blog on Trys Mudford | Sciencx - Accessed . https://www.scien.cx/2020/05/08/urlsearchparams-and-formdata-on-ms-edge/
IEEE
" » URLSearchParams and FormData on MS Edge." Welcome to my blog on Trys Mudford | Sciencx [Online]. Available: https://www.scien.cx/2020/05/08/urlsearchparams-and-formdata-on-ms-edge/. [Accessed: ]
rf:citation
» URLSearchParams and FormData on MS Edge | Welcome to my blog on Trys Mudford | Sciencx | https://www.scien.cx/2020/05/08/urlsearchparams-and-formdata-on-ms-edge/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.