0

Convert JQuery Code Snippet to Vanilla Javascript

How do I convert the following jquery code snippet to pure javascript code $.ajax({ url: 'sample.php', method: 'post', processData: false, contentType: false, cache: false, data: new FormData(this), success: function(resp){ //code goes here } });

10th Aug 2022, 1:06 PM
Dukeson Ehigboria O
Dukeson Ehigboria O - avatar
6 odpowiedzi
+ 3
Best way is to use some tool to help you convert it, doing manualy will take a long time if you have a lot of jQuery code This is some free online tool what can help you to convert it. https://www.workversatile.com/jquery-to-javascript-converter Edit: I tried tools and it didnt help with ajax, so check this to see syntax, you will need to do this manualy https://www.google.com/amp/s/www.geeksforgeeks.org/how-to-make-ajax-call-from-javascript/amp/
10th Aug 2022, 1:58 PM
PanicS
PanicS - avatar
+ 1
Why?
10th Aug 2022, 6:05 PM
Chris Coder
Chris Coder - avatar
0
The truth is that online converters don't give accurate results.
10th Aug 2022, 2:26 PM
Dukeson Ehigboria O
Dukeson Ehigboria O - avatar
0
Suggest one that gives accurate results
11th Aug 2022, 9:51 AM
Dukeson Ehigboria O
Dukeson Ehigboria O - avatar
0
You are right tools can make problems with converting sometimes, thats why is best to convert part by part(small codes) and test if this is working fine, if not convert manualy. Not sure are there any tools what can be installed with npm for example to compile jQuery to javascript while you type, probably this kind of tools exist. I tried to find it but I only find online tools.
11th Aug 2022, 11:53 AM
PanicS
PanicS - avatar
0
We were first to offer our free converter, and now we have multiple ways to convert it. Version 2: https://properprogramming.com/tools/converters/jquery-to-javascript-remover-converter-online-alternative-version-2/ Version 1: https://properprogramming.com/tools/converters/jquery-to-javascript-converter/ JQuery to React: https://properprogramming.com/tools/converters/free-online-jquery-to-react-converter/ All of our code is completely open source, and available online. We also offer reports and guides.
30th May 2023, 11:17 PM
Michael Parisi
Michael Parisi - avatar