What is the version for jquery.ajax in node.js?

Hi, I apologize for my question…I’m still learning node.js. I just want to ask what is the version of jquery.ajax if we use node.js ?..I mean, that we can send parameter to server with specified url and grabbing the response data that was returned from the server and do something with it…just like what i did in jquery.ajax,example

$.ajax({
    type:'post',
    data: 'mydata',
    url:'tomyphpfile',
    success:function(data){
    //do somehting with the data
   }

});

Thank you in advance.

Hey jemz,

jQuery is a browser-only library as far as I know. To make HTTP requests from Node you can use the request module - there’s a SitePoint article about it here: http://www.sitepoint.com/making-http-requests-in-node-js/

Thank you for the quick reply @fretburner :smile:

@fretburner, in http request do we need to run this in terminal or cmd ?..because I want to replace some of my ajax code to this node.js http request.

I’m not really sure what you mean. You have to install the module from the command line/terminal, but obviously you’ll use it within a .js file that you’re running on Node.

@fretburner,Thank you,Okay I will try…I apologize for my question.I am still learning how to use this technology…

@fretburner, I just want to ask where I can find all the List of modules to be use in node.js example the request ?,…what are other modules ?

Check out www.npmjs.com

PS. Just a heads up, you don’t really need to tag people unless you want to notify someone who is not already part of the conversation. If you just hit the reply button beside any of my posts in this thread then I’ll get a notification :smile:

Ok,sorry for that,thank you for the reply once again :smile:

Are you just wanting to make an HTTP request to another server to get back info? You can do that with the default http module.

https://docs.nodejitsu.com/articles/HTTP/clients/how-to-create-a-HTTP-request
http://nodejs.org/api/http.html#http_http_request_options_callback

1 Like

Yeah,Thank you for this. :smile:

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.