Java Reference
In-Depth Information
You again retrieve the value in the Email text box by selecting the element and using the value property.
var emailValue = $(“email”).value;
You then determine if the response from the server designates that the e-mail is available for the user to use.
if (text == “available”)
MooTools is a popular framework because it offers you utility similar to jQuery while maintaining
aspects of traditional DOM programming like Prototype. MooTools also has an animation/effects
component, making it a well-rounded framework. This section can hardly do the framework justice,
so make sure to visit the API documentation at http://www.mootools.net/docs/core .
Summary
This chapter introduced you into the rather large world of JavaScript frameworks.
You learned that JavaScript frameworks were the answer to cross-browser development.
You learned that there are two types of frameworks: general and specifi c. You were also given a
short list of the popular frameworks available today.
You learned where to obtain the fi les needed to use the jQuery, Prototype, and MooTools
frameworks.
You installed jQuery, Prototype, and MooTools and tested each installation with an identical
test page.
You learned how to select and retrieve elements, manipulate the DOM, and work with events
with the jQuery, Prototype, and MooTools frameworks; and you rewrote the DHTML toolbar
script using all three of the frameworks.
Finally, you learned how to make basic Ajax requests using the Ajax components of jQuery,
Prototype, and MooTools; you also rewrote the form validator script using the Ajax capabilities
of the three frameworks.
Exercise Questions
Suggested solutions for these questions can be found in Appendix A.
1.
Modify the answer to Chapter 14's Question 2 using jQuery. Also add error reporting for when
an error occurs with the Ajax request.
2.
Alter the answer to Chapter 14's Question 2 using Prototype. Add error reporting for when an
error occurs with the Ajax request.
3.
If you guessed that this question would be: “Change the answer to Chapter 14's Question 2
using MooTools, and add error reporting for when an error occurs with the Ajax request” then
you won!! Your prize is… completing the exercise.
Search WWH ::




Custom Search