- Describe the life cycle of a Web page. - The life cycle of a Web page involves the items that make the page exist. Those things would include the user (not stated in the text), the browser that communicates with the network via HTTP, the network that holds the url or address for the page being called, the server where the page or documents information files are stored, the server module that is a software framework responsible for retrieving the information about the page from the server to provide an answer to the call from the browser, and finally the external files that may or may not reside on the same server such as a database or images.
- What browser are you using? What version? How do you know? - The answer provided by the text is in the form of a script, and here it is:
This script when run in the console of a browser does not need the script tags and will produce an error if you attempt to use them, but if you run the alert method in the console you will get these results:
In this alert window you are informed as to what browser you are using. What the text doesn't tell you is that every browser will have within its menu tab something that will tell you what version of the browser you have installed and are using. Currently I am using google chrome: Version 43.0.2357.132 m.
- What is the example of a Jacascript event handler? Copy Example 1.2 into your editor and run the program in your browser. Here is the example 1.2 code in operation: This is example 1.2 CLICK HERE An event handler is a trigger that will activate code stored in a value that is attached to the event trigger. Code is executed or run in response to something the user does i.e- clicking on a button, mousing over an element.
- What is the difference between Javascript and Jscript? Jscript is the Microsoft implementation of Javascript.
- Where do Javascript tags go in an HTML page? Does Javascript understand HTML? Best practice is to put Javascript tags just before the closing body tag in an HTML document. Javascript was originally created for form validation on the client side in order to cut down on round trips to the server from the user through the browser, so you could say that Javascript validates HTML but Javascript is a language not a logic system, it understands nothing.
- What is the DOM? The DOM is the Document Object Model and is the browser's interpretation of the HTML document. This treelike structure of the document is useful for the separation and compartmentalisation of the elements of the document for sorting and accessing purposes.
- Define the three layers of the Web page. The three layers of the webpage are Content, Style, and Function. The content layer holds the HTML. The Style layer holds the CSS. The Function layer holds the Javascript.
- How do you set up Javascript in an external file? Javascript in an external file is described with the dot js extension like so; app.js. This file is attached to the HTML file using the script tag like so <script type = "text/javascript" src = "app.js"></script> At this point with the advent of HTML 5 it is no longer necessary to use the type attribute.
- Write a Javascript program that prints a welcome message in a large blue font. Check to see if Javascript is enabled. Use comments to explain what you are doing. For this excercise I used jsfiddle. I colored the font in the body tag attributes using text="blue" Here it is in all of it's glory; Click for Welcome Here is the code that I wrote. Kept it real simple. Click for Code
That is it for this post, I'm sharing here my approach to learning Javascript in hopes that it may solidify the material in my mind, as well as help others who may be searching for a path to understanding Javascript.
Cheers,
Jon
No comments:
Post a Comment