Thread: Ajax?

Page 1 of 2 12 Last
  • Jump to page:
    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2006
    Posts
    77
    Rep Power
    11

    Ajax?


    Could anyone tell me what ajax is about and show me a good example?

    Regards
    Mikael
  2. #2
  3. No Profile Picture
    rebel with a cause
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    May 2004
    Location
    The Batsh!t Crazy State.
    Posts
    5,817
    Rep Power
    3462
    Ajax actually falls under javascript and google is your friend.

    Comments on this post

    • mikael_b agrees : Yes it is
    Dear God. What is it like in your funny little brains? It must be so boring.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2006
    Posts
    77
    Rep Power
    11
    Do you have any example of pages based on ajax?

    Asynchronous JavaScript And XML, or its acronym, Ajax (Pronounced A-jacks), is a Web development technique for creating interactive web applications. The intent is to make web pages feel more responsive by exchanging small amounts of data with the server behind the scenes, so that the entire Web page does not have to be reloaded each time the user makes a change. This is meant to increase the Web page's interactivity, speed, and usability.
  6. #4
  7. fork while true;
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    May 2005
    Location
    England, UK
    Posts
    5,538
    Rep Power
    1051
  8. #5
  9. Back after 2 years!
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Dec 2003
    Location
    Washington, DC Metro
    Posts
    1,747
    Rep Power
    886
    Originally Posted by LinuxPenguin
    There are plenty on the web. Have a google.
    Or just go to Google...

    Let's see... Gmail, Personalize Homepage, the new Calendars, Google Maps....

    Comments on this post

    • netytan agrees
    • LinuxPenguin agrees : heh, never thought of that
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2006
    Posts
    77
    Rep Power
    11
    Originally Posted by Adrastea0413
    Or just go to Google...

    Let's see... Gmail, Personalize Homepage, the new Calendars, Google Maps....
    Damn, cool this i will have to learn

    So do anyone have any link to tutorials where i can learn to move object? like in http://www.google.com/ig
  12. #7
  13. fork while true;
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    May 2005
    Location
    England, UK
    Posts
    5,538
    Rep Power
    1051
    That's just javascript, not ajax.

    It stores the configuration in a cookie too.
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2006
    Posts
    77
    Rep Power
    11
    Hmm, so what can i do with ajax that i can't with javascript?
  16. #9
  17. fork while true;
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    May 2005
    Location
    England, UK
    Posts
    5,538
    Rep Power
    1051
    Okay, let me explain what ajax is

    you have a javascript on your page. then you click a link with a url like "javascript:query('blah');"

    That calls your function 'query' which uses ajax. what ajax does here is make a connection to a specified page, and returns the result to your script. you can then use that result, for example, to modify the content on the page apropriately via script.

    The special thing is that instead of loading a whole new page, the work is done in the background and you can still view the page.
  18. #10
  19. Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jan 2004
    Posts
    1,137
    Rep Power
    173
    AJAX is primarily about making HTTP requests from inside the webpage without having the entire webpage refresh. This way you can send smaller amounts of information back and forth and have webpages dynamically change.

    Before AJAX, people would use hidden frames to send background HTTP requests. I think Gmail may do this b/c it uses a hidden frame. With AJAX, instead of just refreshing the entire hidden frame, you can use the hidden frame as a large session scratch pad since you can store a lot more information there than in a cookie.

    You can do AJAX by calling XMLHttpRequest yourself or by using an AJAX JS library. Some popular libraries include:I've used Prototype which is nice but I'm looking into moving to Dojo because it has built-in JSON support (nicer than hacking it on to Prototype). Prototype drops the response into a specified element's innerHTML which is quick and dirty but designed to update just one client object so you may end up with more AJAX requests than you need/want. JSON stands for JavaScript Object Notation and lets you send multiple data items to the client in a format JavaScript understands.

    Yahoo! Mail beta also an interesting application of AJAX. It's like using MS Outlook in a web browser. Instead of clicking through pages of mail (like Gmail) you scroll through the entire list, kind of like how Google Maps lets you scroll around a map.
    Last edited by Conundrum; May 11th, 2006 at 01:36 PM.
  20. #11
  21. fork while true;
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    May 2005
    Location
    England, UK
    Posts
    5,538
    Rep Power
    1051
    Originally Posted by Conundrum
    AJAX is primarily about making HTTP requests from inside the webpage without having the entire webpage refresh. This way you can send smaller amounts of information back and forth and have webpages dynamically change.

    Before AJAX, people would use hidden frames to make "hidden" HTTP requests. I think Gmail may do this b/c it uses a hidden frame. With AJAX, instead of just refreshing the entire hidden frame, you could use it for a large session scratch pad since you can store a lot more information there than in a cookie.

    You can do AJAX by calling XMLHttpRequest yourself or by using an AJAX JS library. Some popular libraries include:I've used Prototype which is nice but I'm looking into moving to Dojo because it has built-in JSON support (nicer thank hacking it on to Prototype).

    Yahoo! Mail beta also an interesting application of AJAX. It's like using MS Outlook via the web. Instead of clicking through pages of mail (like Gmail) you scroll through the entire list, kind of like how Google Maps lets you scroll around a map.
    Mochikit also features JSON support
  22. #12
  23. Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jan 2004
    Posts
    1,137
    Rep Power
    173
    Originally Posted by LinuxPenguin
    Mochikit also features JSON support
    It does. Do you know what the main differences between Dojo and Mochikit are? For some reason, Dojo seems to have more mindshare among the developers I'm around.
  24. #13
  25. fork while true;
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    May 2005
    Location
    England, UK
    Posts
    5,538
    Rep Power
    1051
    Originally Posted by Conundrum
    It does. Do you know what the main differences between Dojo and Mochikit are? For some reason, Dojo seems to have more mindshare among the developers I'm around.
    No idea, I just used mochikit as part of TurboGears - The python framework which is pleasant to use and powerful, but requires that all requests get redirected through it's own PYTHON webserver (so it's slow as s**t)

    Mochikit seems pretty easy to use tbh, providing you have support from the rest of your framework for JSON format output (which turbogears does) [I presume catalyst being mighty, flexible and powerful does too]
  26. #14
  27. Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jan 2004
    Posts
    1,137
    Rep Power
    173
    Originally Posted by LinuxPenguin
    No idea, I just used mochikit as part of TurboGears - The python framework which is pleasant to use and powerful, but requires that all requests get redirected through it's own PYTHON webserver (so it's slow as s**t)
    It's a shame TurboGears has to be handicapped like that.
    Originally Posted by LinuxPenguin
    Mochikit seems pretty easy to use tbh, providing you have support from the rest of your framework for JSON format output (which turbogears does) [I presume catalyst being mighty, flexible and powerful does too]
    Catalyst has JSON support at several levels including a View that is good for AJAX, a View for JSONRPC as well as JSON config files if desired. You can also choose between a pure perl JSON implementation for easy cross-platform support and a wrapper around libsyck, a fast, memory-efficient C implementation. As according to it's rep, it's very flexible....
    Last edited by Conundrum; May 11th, 2006 at 03:48 PM.
  28. #15
  29. Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jan 2004
    Posts
    1,137
    Rep Power
    173
    I just checked the latest version of Prototype, 1.4.0, which turns out to have built-in JSON support (1.3 didn't). To use the built-in JSON support you need to put the JSON object in the X-JSON header instead of the body. Using X-JSON allows you to send back a JSON object in the header and content in the body. Of course, you can always send back a JSON string in the body and eval it yourself.
    Last edited by Conundrum; May 14th, 2006 at 09:57 PM.
Page 1 of 2 12 Last
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo