122 CHAPTER 3 Getting started with JavaScript
- If you haven’t installed Visual Studio Express 2012 for Web, do so now. You can down-
load this from the Microsoft website. - Start Visual Studio. Click File and choose New Project. Navigate to Installed | Templates
| Visual Basic or Visual C# | ASP.NET Empty Web Application. - Set the name of your application to WebCalculator.
- Select a location for your applications.
- Set the solution name to WebCalculatorSolution.
- Be sure to keep the Create Directory For Solution check box selected.
- Click OK to create your new project.
When the application is created, you will have an empty project. - In the Solution Explorer window, add a home page by right-clicking the project node.
Click Add, and then choose HTML Page. Name the page default.html and click OK. - In the Solution Explorer window, right-click the default.html file and choose Set As
Start Page. - Open the default.html page and enter Web Calculator into the
element. - Enter the following HTML into the element to provide a basic user interface
for the calculator:
- In the Solution Explorer window, add a JavaScript file for your code by right-
clicking the Scripts folder; click Add and choose JavaScript File. Set name to
CalculatorLibrary. js, and click OK. - To see what you have so far, press F5 to start debugging the application. You should
see a white screen with a crude calculator interface, as shown in Figure 3-19.