0

I am using (express framework and hbs engine) and to develop an application.

I want to implement an ajax call to to page for partial post back.

pkp
  • 300
  • 3
  • 7
  • 1
    what do you mean by "ajax call to to page" ? – pfried Feb 25 '13 at 09:44
  • i have 2 select box.. on elect of one selectbox value i want to populate other selectBox. and i do not want to refresh hole page. so i want to do partial postback... plz suggest how to achive it in code level using node.js – pkp Feb 25 '13 at 10:45
  • 2
    This has been answered in several ways. Just add a `route` for your API and return a JSON response. You don't need socket.io. http://stackoverflow.com/questions/6289276/nodejs-express-ajax-posting-w-jquery-and-recieving-response – WiredPrairie Feb 25 '13 at 11:42
  • http://stackoverflow.com/questions/6317219/ajax-to-refresh-a-partial-view-using-express-and-jquery?rq=1 – Amol M Kulkarni Feb 25 '13 at 11:47
  • i am using hbs as engine... plz suggest based on that... – pkp Feb 26 '13 at 04:46
  • i m able to add Ajax now and getting the filter data. but my problem is that i m not able to render it in my html page – pkp Feb 26 '13 at 12:34

2 Answers2

0

As mentioned by others in comments, the best approach for this is described in Ajax to refresh a partial view using express and JQuery?

Community
  • 1
  • 1
Josh Wulf
  • 4,727
  • 2
  • 20
  • 34
-1

>*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
}); }

pkp
  • 300
  • 3
  • 7
  • create your sever code function and pass url with parameter... it will give a partial rander to your code – pkp Mar 09 '13 at 09:33