Convert Javascript to Jquery
Hi, i have to convert this javascript to jquery for wordpress. How do it?
LoginCard : function(){
var This = this;
var o = $("#AreaRiservataForm");
var data = o.serialize();
console.log(data);
//alert(data)
$.ajax({
type: 'post',
url: This.sp,
data: data,
success: function(data){
console.log(data);
//alert(data)
data = JSON.parse(data);
if(data.status>0){
o.find("input[name='codeLogin']").val( data.codeLogin );
o.attr("action","/card/");//E' Importante che l'ultimo Slash (/) sia presente altrimenti non passa i dati in POST
//o.attr("target","_blank");
o.submit();
}else{
vex.dialog.alert('Login non corretto');
}
}
});
},