AJAX function using jquery

Jquery ajax function

var ajax = {
    go: function(type, url, data, callback) {
		$.ajax({
			type: type,
			url: url,
			data: data,
			success: function(msg){
				callback(msg);
			},
			error: function(XMLHttpRequest, textStatus, errorThrown){
				alert(errorThrown);
			}
		});
    }
};
This entry was posted in Javascript, Jquery and tagged , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>