Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Send Form Data Using Ky AJAX

async function(){
	const data = document.getElementById("myForm");
	
const fd =	new FormData(data);
let data = Object.fromEntries(fd);
 
const json = await ky.post('/test', {json: data}).json();

	console.log(json.x);
    
    
  ....
  <form id="myForm">
  <input name="value1" />
  </form>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Send #Form #Data #Using #Ky #AJAX
ADD COMMENT
Topic
Name
9+7 =