Esempio di iscrizione ad un servizio esterno di newsletter tramite ajax e JQuery
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js " type="text/javascript"></script>
<form id="Form" method="post">
<input id="email" name="email" value="test@MIOSITO.it" type="hidden"/>
<input id="user" name="user" value="user2467" type="hidden" />
<input id="list" name="list" value="11" type="hidden" />
<input id="confirm" name="confirm" value="1" type="hidden" />
</form>
<script type="text/javascript" >
function jsoncallback() {
var url = "http://newsletter.MIOSITO.com/external/subscribe.cfm"; // the script where you handle the form input.
$.ajax({
type: "POST",
url: url,
dataType : 'json',
data: $("#Form").serialize(),
success: function(data)
{
alert(data); // TEST
}
});
return false; // Evita l'esecute
};
jsoncallback();
</script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js " type="text/javascript"></script>
<form id="Form" method="post">
<input id="email" name="email" value="test@MIOSITO.it" type="hidden"/>
<input id="user" name="user" value="user2467" type="hidden" />
<input id="list" name="list" value="11" type="hidden" />
<input id="confirm" name="confirm" value="1" type="hidden" />
</form>
<script type="text/javascript" >
function jsoncallback() {
var url = "http://newsletter.MIOSITO.com/external/subscribe.cfm"; // the script where you handle the form input.
$.ajax({
type: "POST",
url: url,
dataType : 'json',
data: $("#Form").serialize(),
success: function(data)
{
alert(data); // TEST
}
});
return false; // Evita l'esecute
};
jsoncallback();
</script>
Commenti
Posta un commento