Reputation: 189
I'm using the colorbox plugin and according to the docs, the data
property allows submitting GET or POST values through an ajax request. I can submit my data via GET no problem, but can't figure out how to switch to POST. I'm using serialize to set the form data in name/value pairs. I have the code below:
Is there a way to set this to POST?
var data = $('form').serialize();
console.log(data);
// Preview newsletter - bind colorbox to event
$('a#preview').colorbox({
width: '670px',
href: $(this).attr('href'),
data: data
});
return false;
});
Upvotes: 3
Views: 6882
Reputation: 833
The data property will act exactly like jQuery's .load() data argument, as ColorBox uses .load() for ajax handling.
Upvotes: 0