Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

jquery get form data

$('form').serializeArray()
// gives 
// 	[ {"name":"foo","value":"1"},
//  {"name":"bar","value":"xxx"},
//  {"name":"this","value":"hi"} ]


// or 

$('form').serialize() // gives : "foo=1&bar=xxx&this=hi"
Comment

jquery form data

var fd = new FormData();    
fd.append( 'file', input.files[0] );

$.ajax({
  url: 'http://example.com/script.php',
  data: fd,
  processData: false,
  contentType: false,
  type: 'POST',
  success: function(data){
    alert(data);
  }
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: jquery each response 
Javascript :: how to get last string in javascript 
Javascript :: export all functions 
Javascript :: javascript define a global variable 
Javascript :: Easy Way to Check if 2 Arrays are Equal in JavaScript 
Javascript :: vue cors 
Javascript :: js get html content 
Javascript :: difference between the `.append()` method and the `.appendChild()` method 
Javascript :: javascript array size 
Javascript :: javascript print path 
Javascript :: json stringify close circle 
Javascript :: add days in mome 
Javascript :: percentage formula in javascript 
Javascript :: javascript random element from array 
Javascript :: find input by value attribute javascript 
Javascript :: anime js link 
Javascript :: new date parameters javascript 
Javascript :: how to use a fixed time zone in nodejs 
Javascript :: detect iframe content change javascript 
Javascript :: get all indexes for element in array javascript 
Javascript :: regex for comments javascript 
Javascript :: keydown events 
Javascript :: convert an array to string javascript 
Javascript :: js platformer 
Javascript :: jquery is element hidden 
Javascript :: json query online 
Javascript :: ctx.fillstyle 
Javascript :: style scoped vue 
Javascript :: foreach break js 
Javascript :: how to make back button react 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =