heihachi88
6/9/2014 - 4:34 AM

Ajax request example. If you want to make DOM manipulation in success callback, then define a selector outside ajax function.

Ajax request example. If you want to make DOM manipulation in success callback, then define a selector outside ajax function.

$.ajax({
	method: 'post',
	url: '/del-image',
	data: {imgUrl: thisImg, id: pageId},
	success: function(data) {
		alert(data);
	},
	error: function(e) {
		alert('Error' + e);
	}
});