4

I would like to create a server an Erlang capable of receiving and sending AJAX messages. Is there a module that provides this functionality?

1
  • 4
    From who's point of view is this "Not A Real Question"? The user has simply expressed what he wants to learn, in his own words, from his own understanding. Instead of shutting him down and turning him away try to provide something, anything, to help point him in right direction as @Muzaaya Joshua and others below have taken the time to do. Commented Dec 20, 2013 at 22:58

3 Answers 3

10

Well, i would not call it a module, perhaps a "library" would be a better description. check out these: Mochiweb, Webmachine and Nitrogen -- the master of Event Driven Web Apps.

What you need is RESTFUL services in Erlang. You want to be able to initiate HTTP GET or POST requests from your Ajax, say with JSON encoded Data and you expect to get back JSON encoded responses. Mochiweb has a good JSON parser and its Light Weight. The heavy duty Web server called Yaws is very capable of doing what you want. There is a good tutorial about RESTFUL services with Yaws. The most wonderful thing about all these is that you can use all or several of them together in the same web App (but you need some experience to do so, it aint very obvious for starters!)

However, you will need to get a grip of Erlang Concepts of doing things and you will then find all these frameworks very easy. These are not the only ones you can look into, there is ErlyWeb, Erlang Web and so many upcoming libraries.

Am sure you will find any one of these useful.

1

Well, it really depends on what you mean by "Ajax messages". Ajax requires nothing more than regular pages do. Just send back the requested data instead of a new page.

If you want a nice framework for web apps in Erlang, check out Nitrogen.

1

AJAX as in "asynchronous requests within browser" is client-side technology that allows doing additional HTTP requests without reloading page.

Any HTTP server is capable of sending and receiving AJAX messages because those are just HTTP requests.

You can use any debugging tool(firebug, chrome javascript console, etc) to check that.

Not the answer you're looking for? Browse other questions tagged or ask your own question.