2.19. Just Do ItNow that you've learned about static JavaScript, creating request objects, and better error handling, you need to make some more changes to pizza.html. Open up your HTML, and move all the code in createRequest() outside of the function, right after the line of JavaScript that looks like this: <script language="javascript" type="text/javascript"> var request = null;All the code that is in createRequest() should go here. </script> Next, remove the createRequest() function altogether, and also remove the line in getCustomerInfo() that ran the createRequest() function. You can test your changes by commenting out the JavaScript that creates a request object for the type of browser you're using. If there are any errors, they should show up immediately, before you get a chance to use the Break Neck order form. Once you're done testing, remove all your comments, and make sure pizza.html runs on both Microsoft and non-Microsoft browsers. Save your changes, and you're ready to turn the page. Any errors get reported before the order form ever gets loaded. Much better! IE reports this error over a blank page, since it hasn't loaded all the HTML yet.
|