how to send parameters in ajax get method code example

Example 1: jquery ajax get

$.ajax({
    	url: "www.site.com/page",
    	success: function(data){ 
    	    $('#data').text(data);
    	},
    	error: function(){
    		alert("There was an error.");
    	}
    });

Example 2: how to send data using ajax

$.ajax({
	url: "/something", // the url we want to send and get data from
    type: "GET", // type of the data we send (POST/GET)
    data: {p1: "This is our data"}, // the data we want to send
    success: function(data){ // when successfully sent data and returned
    	// do something with the returned data
   		console.log(data);
    }
}).done(function(){
	// this part will run when we send and return successfully
    console.log("Success.");
}).fail(function(){
    // this part will run when an error occurres
    console.log("An error has occurred.");
}).always(function(){
    // this part will always run no matter what
  	console.log("Complete.");
});