in black and white
Main menu
Home About us Share a book
Biology Business Chemistry Computers Culture Economics Fiction Games Guide History Management Mathematical Medicine Mental Fitnes Physics Psychology Scince Sport Technics

Javascript for dummies. Quick Reference - Vander

Vander Javascript for dummies. Quick Reference - Wiley Publishing, 2002. - 115 p.
Download (direct link): javascriptquickreference2002.pdf
Previous << 1 .. 12 13 14 15 16 17 < 18 > 19 20 21 22 23 24 .. 72 >> Next

Title for your Web page: <TITLE>.. .</TITLE>
Titles play an important part in communicating your message (whatever that may be) to your users. Not only are the words in your title used by many Web-searching programs, but when users save a reference to your Web page (sometimes called bookmarking), your title is what appears on their list of saved references. For these reasons alone it’s worth spending a little time on wording your title.
Notice in the following example that the <TITLE>. . .</TITLE> tags are placed between the <HEAD> . . . </HEAD> tags.
Dave's Retail Catalogue of Restored Antique Hood-Burning Stoves </TITLE>
Although you’re not required to place the title between the <H EAD> tags (the title will still appear if you place the
<TITLE> . . .</TITLE> tags after the <HEAD> . . . </HEAD> tags), the example shows the standard style used by the Web-sawy crowd.
JavaScript Basics
This part is like a JavaScript grammar book, dictionary, and thesaurus — all rolled into one. In this part, you find the nuts-and-bolts mechanics of writing JavaScript statements — from syntax to special keywords, from declaring variables to defining and calling functions. You also find an overview of all the objects you can work with in JavaScript. (For a detailed description of each object in the overview, see also Part III.)
In this part...
v* Understanding the security issues associated with JavaScript scripts
v0 Becoming familiar with the JavaScript object model
v* Unraveling JavaScript syntax and expressions
6 About JavaScript Security
About JavaScript Security
Because JavaScript runs on the client computer, its ability to cause security breaches is fairly limited. Security issues are more of a concern when client/server communication is involved, and this type of communication isn’t included in JavaScript’s bag of tricks.
As of this writing, only one minor problem has been widely publicized, and that’s the ability of a mischievous JavaScripter to set up a harmless-looking button that sends an e-mail message (complete with your e-mail address) to the mischief-maker, without your knowledge.
Fortunately, this problem only rears its ugly head with the Netscape Navigator 3.0 Web browser, and it’s completely preventable. From the Navigator browser main window, all you have to do is choose OptionsONetwork PreferencesOProtocols. Then, in the Show an Alert Before box, click the check box labeled Submitting a Form by Email, and the problem is solved: Any time that your Web browser attempts to send e-mail, an alert window notifies you and gives you the opportunity to cancel the proceedings.
Because developers tend to take security issues very seriously, expect each version of Netscape Navigator and Microsoft Internet Explorer to be more secure than its predecessor.
Web security is a hot topic these days — whenever information passes across the Internet, there’s always an associated security hazard. CGI programs, plug-ins, Java applets, and cookies all present different security risks that you may want to be aware of. If you plan to integrate your JavaScript scripts with any of these elements (or just to find out more about staying secure on the Internet, in general), check out Computer Security For Dummies, by Peter Davis and Barry Lewis (published by IDG Books Worldwide, Inc.).
This Web site is devoted exclusively to JavaScript-related ЩРр' security issues:
http://с ia с. ас/Java secure.html
Basics of the JavaScript Object Model
You can work with three main kinds of objects in JavaScript:
♦ Built-in data types
♦ Objects that make up a Web page
♦ Utility objects
Read on for a quick rundown of each object type and the differences between them.
Basics of the JavaScript Object Model 37
Built-in JavaScript data types
Numbers, Boolean values (true or false), and strings (a bunch of characters surrounded by quotes, like “this”) are such basic programming building blocks (called data types) that you don’t even have to create special objects to use them in JavaScript. All you have to do is specify a numeric, Boolean, or string value, and the JavaScript interpreter takes care of the rest.
Look at the following examples to see what I mean:
Built-in Data Type JavaScript Syntax
Boolean var 1oveWork = true
null var middlelnitial = null
number var myAge = 29
stri ng var fullName = "Kris Kringle"
In the preceding table, you create four different variables to hold four different values, each associated with a different data type. The first variable, loveWork, is assigned the Boolean value true; the second variable, middl elniti al, is assigned the null value; the third variable, my Age, is assigned a number; and the fourth value, f ul 1 Name, is assigned a string value. Taken together, the JavaScript interpreter reads these variables as, “Kris Kringle is age 29, has no middle initial, and loves his work.”
The null data type means “nothing” (which is different from simply not assigning any value). The null data type is a valid value all on its own.
Previous << 1 .. 12 13 14 15 16 17 < 18 > 19 20 21 22 23 24 .. 72 >> Next