Jquery Ajax

var ajaxUrl = "phpfile.php";
            $("#buttonAjax").click(function () {

                    type: "GET", 		//GET or POST or PUT or DELETE verb
                    url: ajaxUrl, 		// Location of the service
                    data: {key:value,key1:value1}, 		//Data sent to server
                    Type: "POST",		// content type sent to server
                    dataType: "html", 	//Expected data format from server (html/json)
                    processdata: true, 	//True or False
                    success: function (result) {//On Successful service call
                    error: ServiceFailed	// When Service call fails

                return false;
//in php file (phpfile.php)
//perform functionality


Leave a Reply

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