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 } });
6 Respostas
+ 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/
+ 1
Why?
0
The truth is that online converters don't give accurate results.
0
Suggest one that gives accurate results
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.
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.