In jQuery, we have $('form').serialize()
to post all the form data in a single line. Is there any method available in JavaScript to post form data like this or is there an alternative in JavaScript for the code below code?
var url = "path.php";
$.ajax({
type: "POST",
url: url,
data: $("#idForm").serialize(), //like this i need in js
success: function(data)
{
}
});