Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

fetch method post handing the post add on php

// if you are going to use post method you need to send the data/body  using the formdata object
var url = '/your/url';
var formData = new FormData();
formData.append('x', 'hello');

fetch(url, { method: 'POST', body: formData })
.then(function (response) {
  return response.text();
})
.then(function (body) {
  console.log(body);
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: Get width of screen on resize event 
Javascript :: import everything javascript 
Javascript :: find if two elements in array sum to given integer js 
Javascript :: next js environment variables 
Javascript :: for loop in javascript 
Javascript :: js filter array of objects by another object 
Javascript :: what is react 
Javascript :: returned value by findOneAndUpdate 
Javascript :: datatable bootstrap cllick on specific button 
Javascript :: sum of array javascript 
Javascript :: append raw html javascript 
Javascript :: date.gettime is not a function 
Javascript :: check object has key javascript 
Javascript :: Run project in visual studio with iis express 
Javascript :: formik validate field array select 
Javascript :: js object sort 
Javascript :: redux reducer 
Javascript :: flatten nested json objects 
Javascript :: ios react native detect locale 
Javascript :: convert string to float javascript 
Javascript :: angular get class list for element 
Javascript :: install express generator 
Javascript :: manually set jquery text box 
Javascript :: download datepicker js 
Javascript :: merge 2 arrays jquery 
Javascript :: javascript how to pass more than one selector in querySelectorall 
Javascript :: js reduce method 
Javascript :: how to set button width in javascript 
Javascript :: how to mock a library in jest 
Javascript :: import npm module node.js 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =