jQuery - ajax

var prospectData = { "prospectID" : '${CustomerHolisticView.clientID}' };

            if(confirm("Are you sure to delete this prospect record?")){

$.ajax({

url: '<portlet:resourceURL id='deleteProspect'></portlet:resourceURL>',

type: 'GET',

datatype:'json',

data: prospectData,

success: function(data){

data = data.slice(1, data.length-1);

if(data == 'SUCCESS'){

window.location = '<portlet:renderURL><portlet:param name='action' value='returnTosearchResult'/></portlet:renderURL>';

} else {

$('#errorProfile').html('<div>'+data+'</div>');

}

}

});

}

猜你喜欢

转载自nethub2.iteye.com/blog/2379201