I have to admit I am not able to understand the way Lift handles Ajax. Please forgive me for my silliness regarding this. I have read several posts and read book on Lift Ajax. But I am still having a problem to understand clearly how it works. That is mainly because of the way I learnt to understand Ajax or what programming background I am from. Please forgive my lack of understanding and I request your help.
I think one of my problems might be all the Ajax articles or samples are also explaining how to do certain other things (for example UI with CSS transforms) when explaining how Ajax works in lift. Being a new comer (or due to some limitations due to my background) I am getting lost. To explain my confusion, I have made a specific question below. If I know that answer I think I can get much better understanding from the samples. Please see the jQuery example below.
$.get('login.php',formData,processData);
This is an example of typical Ajax call in jQuery (get function). This code passes three arguments to the get() function. The first—‘login.php’— is a string identifying where the data should be sent—in this case, a file on the server named login.php. The second argument is the query string containing the data that’s being sent to the server—the login information. Finally, process- Data refers to the callback function that will process the server’s response.
I want to understand the Lift side abstractions that map to the following
1. get
2. server side file or script that will handle this ajax call (login.php) here.
3. formData – Arguments that go the server
4. processData – The call back function.
If I know what Lift side features map to these that will provide me the clarity on Lift Ajax. Thank you very much.
-Anand
-Anand
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code
David,
Thank you for your quick response.
First I want to explain one of the foremost reasons why I am interested in Liftweb is its built-in security. I was entrusted with turning around the security holes of a 50 Million SaaS product developed in some legacy Microsoft web technologies and .net. I know how much of an effort it was in terms of turning around developers mentality and the training that has to take place. Even though we made our product secured we could not do things like having GUID based transaction between the client and server. I feel Liftweb’s genius-ness is the having security incorporated in its core and making it out of the box. This is my primary reason to start looking at Lift. Also the overall architecture is enterprise class. It is as elegant framework as Scala being a concise and productive programming language. Whenever I required any information pushed to browsers from server my development team will say all sorts of stories and I would give up the feature as it is not worth the effort. Here you have comet out of the box. So I very well understand the power and supremacy of Lift, I am very appreciative of this framework and thankful that such wonderful innovation is open source. Also the community is very passionate. You can sense that every day. You cannot build or inspire such a community without the architectural strength of the product.
Coming back to your answer, I have to look at SHtml object and its documentation to understand Ajax get and post signatures and start familiarizing with Ajax to start with and start benefitting the extra powers of Ajax. Can I assume http://scala-tools.org/mvnsites/liftweb-2.0/framework/scaladocs/net/liftweb/http/SHtml$object.html link to be good starting point to understand more about sHtml? Or if you have more resources on this, please point them to me. Thank you again.
-Anand