I am building a self serve email campaign app for a client. I would like the client to download the template they desire and the data will be sent to another page.
I am using the Jquery.Ajax to post the data, though I need it to select the content of the html template the client chooses:
Get template
function getTemplate(id){
$.ajax({
type: 'get',
url: 'ay/templates/Postcard_Template.html,
data: 'EmailTemplate_id=' + id,
success: function(data) {
$('#shadow').fadeIn('slow');
$('#popupContact').fadeIn('slow');
$('#content').html(data);
}
});
Post to new page…
$.ajax({
type: 'Post',
url: 'wwww.Test.co.uk/test.html,
data: 'EmailTemplate_id=' + id,
success: function(data) {
$('#shadow').fadeIn('slow');
$('#popupContact').fadeIn('slow');
$('#content').html(data);
});
I will then bind this to a form, any suggestions if this looks correct?
Thanks, Tom.
All I can see wrong is a single quote missing at gettemplate:
and a single quote + bracket at post template:
My suggestion if u are gonna bind this to a form u should serialize the form and pass it to the data parameter.
Short example:
then adjust your ajax data:
Good luck Tom 🙂