I am a bit confused about how to use get() and post() in query to get data from a node.js server if the node.js server parses data from a json file and serves the html at a localhost:3000, will the client side code look something like this:
$(document).ready(function() {
$.ajax({
url: 'localhost:3000/',
dataType: "json",
success: function(data) {
$("#test").append(data);
},
error: function(jqXHR, textStatus, errorThrown) {
alert('error ' + textStatus + " " + errorThrown);
}
});
});
I am confused about what datatype etc means.