Thursday, 7 December 2017

Personal Hosting Web Pages


Your Web pages are your personal ambassadors to the world. They make a statement about you. Naturally, you can't control everyone's reaction to your pages; some people simply are not going to take an interest in what you have to say.
But you can take simple steps in terms of the content of your pages and in terms of the presentation of your pages to maximize the impact you want your pages to have.

Live documents are Web pages that change as time passes. You can create timers in your code.
When the timer counts down, a JavaScript expression is executed. You can do many things with timers, such as scroll messages on the screen or load a document when the timer counts down.

HTML enables you to take plain text and turn it into an attractively laid out document. It also lets you turn the text into an ugly mess that no one would want to read. JavaScript confers an even greater ability to create a spectacular document, and an even greater ability to create a hideous page that no one will want to read.
You can also even crash the browser by using the java script.

Using JavaScjavascriptan also make it easier for the user to quickly navigate the document outline. You can allow the user to hide irrelevant portions of the outline, leaving only the portions that are important to him or her.
You can do this by making the outline a dynamic document created on the fly instead of a static document loaded from the server.
Although you can create a workable outline document without JavaScript, JavaScript can improve upon the solution, if you put in a little work.
With JavaScript, you can keep the outline visible while the user reads the document, and you can make the outline much easier to navigate.

The other way of ending a comment is to begin a JavaScript one-line comment-the kind that starts with // and ends with the end of the source line. Just make sure that the --> is at the end of the comment. As with the first method, browsers that don't support JavaScript will close the comment that was begun after the <SCRIPT> tag when they see the --> at the end of the comment. Netscape sees it as a routine JavaScript comment.
And the only drawback to this technique is that it forces the </SCRIPT> tag to be on the next source line. If it were on the same line as the one-line comment, it would become part of the comment.
It's a sad but true fact that not all browsers support JavaScript. Readers using popular browsers such as NCSA Mosaic will not benefit from your JavaScript expertise.
.Unless you want to alienate those readers, you need to be sensitive to the needs of the Netscape-deficient. Two major errors to avoid are littering the screen with JavaScript code and leaving a blank page for the reader to ponder.

If you have a lot of JavaScript code in your pages, the spell checker will probably go ballistic over the code. It will not recognize your variable or function names unless you've entered them into the spell checker's dictionary, which is a practice I do not endorse.
The solution is to make a copy of your page and remove the contents of the <SCRIPT> element before running the copy through a spell checker. Because you'll be making changes by hand, this should be an iterative process. Of course, you can avoid the iterative process if you have access to software that will merge changes automatically.
The big problem with the non-JavaScript solution is the enormous expense in bandwidth. With every guess, a new HTML page is downloaded from the server. That's a lot of traffic!

The TARGET attribute tells the browser to display the submission results in the viewer frame.

Without that, the results would replace the contents of the control frame, and the user would lose his or her view of the data.

Form modification is the process by which data entered by a user is translated into another format before being submitted to the form's server.
When data from a form is submitted to its server, the data has to be formatted in a way that the server can understand. The format is usually in the form

<url>?<field1=value>?<field2=value>...

where <field1>, <field2>, and so forth are the NAME attributes of the INPUT, SELECT, and TEXTAREA elements of the form. The values are, with minor translations made by the browser, the VALUE attributes of those elements.


From the user's perspective, this translates to a slow game. It's okay for the user to deliberate about his or her next move, but the computer is expected to respond instantly! Instead, the user gets to watch the status bar display the number of seconds until the next page is downloaded.
The drawPlayingField() function is responsible for redrawing the playingfield frame after each guess, as well as for drawing the initial frame. Like the displayScoreBoard() function you saw earlier, it creates a new HTML page and writes it to the playingfield frame.
However, it's more dynamic than displayScoreBoard(): It uses the global variable score to determine how to draw the gallows and the hanged man, and it uses the guessedLetters array to determine which letters to fill in, and to display which letters the user has already guessed. While determining which letters to fill in, it also notes whether the user has guessed the word: