The document discusses developing and testing JavaScript components. It recommends:
1. Generating clean HTML and JavaScript code separately to maximize flexibility and performance. HTML serves as the contract between server and client-side code.
2. Testing JavaScript code with frameworks like QUnit or YUI Test. Tests should make asynchronous requests synchronous and wait for responses.
3. Integrating unit tests into a test suite that runs across browsers to catch errors and failures. Integration tests should confirm the server generates the expected HTML.
13. First attempt The server generates HTML + javascript: <input type=”text” name=”parent” id=”parent” /> <script> new Autocompleter($(“parent”), { url: “http://localhost/getCandidates.json” }) </script>
20. This is your javascript code , not generated by the server: $$('input.autocompleter').each(function(e) { new Autocompleter(e, { url: e.getAttribute('url'); }); });
21.
22. All javascript code is together at the end of the page or inside external javascript files
This is the typical look of an application that starts adding a couple of js features and ends up like the Loch Ness Monster. Ajax is not like XP, it should not be improvised.
Cuando se elige entre REST y RIA, tener en cuenta que a una aplicación en intranet le da igual estar indexada (y otros casos como Google wave,por ser contenidos de corta caducidad), pero al resto frecuentemente le hace falta indexarse. Hay un museo en Madrid que tiene en torno al 50% de accesos desde google. Para nosotros es el 75%.
Lo puedo poner en una pagina o en un script general
Puedo probar manualmente con firebug Puedo modificar lo que pruebo Puedo inspeccionarlo todo Uso un fichero local