Section 9.4. Summary


9.4. Summary

  • Ajax is a useful tool when used wisely. The authors of WhatWhat Status were able to ensure that everyone using the product would have a modern Ajax-capable browser, so they made extensive use of Ajax in the project's page to reduce the time their users wait for pages to reload and to make it easy to view or hide individual page elements dynamically according to what the user needs to see at the time.

  • WhatWhat Status makes extensive use of JSON to pass data back to the client browser, where a simple eval turns the JSON string directly into JavaScript objects that can be used in JavaScript functions that update the page.

  • The WhatWhat Status authors make use of the widely implemented innerHTML method to update various elements in the page. Even though innerHTML is not part of the standard, it is implemented on every modern browser, and it can be a lot easier to use than DOM manipulations.

  • MochiKit adds the idea of callbacks to its request objects. You can use the addCallback() method to indicate what function should be run by the browser when a response is received back from the server.

  • TurboGears includes simple_json that can automatically transform most native Python data types into JSON strings, so it is extraordinarily easy to create methods that return JSON to the browser.




Rapid Web Applications with TurboGears(c) Using Python to Create Ajax-Powered Sites
Rapid Web Applications with TurboGears: Using Python to Create Ajax-Powered Sites
ISBN: 0132433885
EAN: 2147483647
Year: 2006
Pages: 202

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net