dataType: json is the return data type of the ajax call
data are the parameters that your php file/servlet will be expecting. to pass a json see example below, its a mixed of json and normal parameters
var params = {a:1,
b:2,
myJSON: JSON.stringify({data1:1, data2:2, data3:3})}
jQuery.ajax({
type: "POST",
url: "some/url/of/php/file",
data: params,
dataType: "json",
success: function(response){
// this should catch what ever is returned by your php file
alert(response)
},
error: function(msg) {
alert('error');
}
});
In your php file you can access the data being passed is like this $_POST['a'], $_POST['b'], $_POST['myJSON']
dataType is the return type of your php file not the parameters being sent to the php file.