SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 77 | Next

Robin Pars, Laurence Moroney, and John Grieb

"Foundations of ASP.NET AJAX"


CHAPTER 3 ?–  THE MICROSOFT AJAX LIBRARY: MAKING CLIENT-SIDE JAVASCRIPT EASIER 34
Figure 3-3. Adding a new file to your solution
In the dialog box that is displayed, select the JScript File template, and enter a name
for the file. In this example, the name AJAXBook.js was used, but you may call it anything
you like (see Figure 3-4).
CHAPTER 3 ?–  THE MICROSOFT AJAX LIBRARY: MAKING CLIENT-SIDE JAVASCRIPT EASIER 35
Figure 3-4. Creating a new JavaScript file
You can now add the code that implements the namespace AJAXBook and the class
Car. When you use Visual Studio 2005 to create and edit JavaScript code, it provides syntax
coloring to make the code easier to understand and maintain. Unfortunately, Visual
Studio 2005 doesn??™t add Intellisense; in other words, when you say ???Type,??? it doesn't
bring up a list of members on the Type type.
Figure 3-5 shows the namespace AJAXBook and the class definition for Car in the editor.
CHAPTER 3 ?–  THE MICROSOFT AJAX LIBRARY: MAKING CLIENT-SIDE JAVASCRIPT EASIER 36
Figure 3-5. Implementing your namespace and class in JavaScript
You??™ll learn what all this syntax means later in this chapter, but it will make more
sense if we run through the entire example first.


Pages:
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89