I am using node.js (express framework and hbs engine) and mongodb to develop an application. I want to implement an ajax call to to page for partial post back.
Try the socket.io - framework for nodejs: socket.io on github It tries to get the best out of the used browser to communicate with the server. This includes websockets, AJAX, etc... See: browser-support. With socket.io you dont have to bother about ajax-calls. It just works ;)
As mentioned by others in comments, the best approach for this is described in Ajax to refresh a partial view using express and JQuery?
>*pass ur URL,and parameter to this function:It is working fine....*
function ajaxRequest(url, succesCallBck, completeCallBck, errorCallBck)
{
$.ajax({
url: url,
type: "POST",
dataType: "json",
complete: completeCallBck,
success: succesCallBck,
error: errorCallBck
});
}