Joko Wandiro Joko Wandiro - 1 year ago 91
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){

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download