Joko Wandiro Joko Wandiro - 6 months ago 19
Javascript Question

How to add data via $.ajax ( serialize() + extra data ) like this

I want to add extra data after i use $('#myForm').serialize() + extra data

type: 'POST',
url: $('#myForm').attr('action'),
data: $('#myForm').serialize(), // I WANT TO ADD EXTRA DATA + SERIALIZE DATA
success: function(data){


What kind of data?

data: $('#myForm').serialize() + "&moredata=" + morevalue

The "data" parameter is just a URL encoded string. You can append to it however you like. See the API here.