Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

not getting any response with fetch javascript method

const postURL = 'http://localhost/myproject';
const frm = document.getElementById('userContactForm');
const formData = new FormData(frm);
formData.append("submit",1);
fetch(postURL, {
	method: 'POST',
	body: formData,
}).then(res => res.json()).then((resData) => {
	console.log(resData);
	frm.reset();
}).catch(error => console.warn(error));
 
PREVIOUS NEXT
Tagged: #response #fetch #javascript #method
ADD COMMENT
Topic
Name
6+9 =