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 .. 6 7 8 9 10 11 < 12 > 13 14 15 16 17 18 .. 72 >> Next

<PARAM NAME="Scrol1Styl eX" VALUE="Circular"> <PARAM NAME="Scrol1 Sty 1 eY" VALUE="Circular"> <PARAM NAME="szURL" VALUE="http:// www.i">
<PARAM NAME="Scrol1 Del ay" VALUE=100>
<PARAM NAME="ScrollPixelsX" VALUE=0>
<PARAM NAME="Scrol 1 Pi xel sY" VALUE=30>
<PARAM NAME="DrawImmedi atel у" VALUE=1>
<PARAM NAME="Whitespace" VALUE=0>
<PARAM NAME="PageFli ppi ngOn" VALUE=1>
<PARAM NAME="Wi dthOfPage" VALUE=640>
</0BJ ECT>
Graphic image: <IMG>
To embed an image in HTML, use this tag:
<IMG NAME="myImage"...>
To access that image in Navigator’s implementation of JavaScript, use this identifier: document. myFo rm .my I mage.
Inserting Form Elements into \lour Web Page 1
You can embed any image file into a Web page by using the < I MG> tag. As you may expect, the position of the embedded image is determined by the position of the < I MG> statement in the HTML file. For example, if you define a push button, an embedded image, and a set of radio buttons, in that order, that’s the order in which they appear on your Web page.
Tag Syntax for < IMG> Explanation
<1 MG Opening <IMG> tag
NAME="imageName" Name of image for internal coding purposes
SRC="1ocati on" URL of image to load
[L0WSRC="1 ocati on"] URL of alternative low-resolution version of the image
[HEIGHT="pixels" | "value"%] Height of image, in pixels or as a percentage of window height
[WIDTH="pixels" | "value"%] Width of image, in pixels or as a percentage of window height
[HSPACE="pi xels"] Horizontal space between left and right sides of the image, and the left and right edges of the window, in pixels
[VSPACE="pixels"] Vertical space between top and bottom of image and top and bottom edges of window, in pixels
[B0RDER="pixel s"] Width of the image's border, if any, in pixels
[ALIGN = "posi ti on" ] Specifies alignment of image
[ISMAP] Whether the irfiage is a server-side map
[USEMAP="1ocati on#mapName"] Whether the image is a client-side map
[onAbort="handlerText"] Code to execute when a user aborts an image load
[onError="handlerText"] Code to execute when an error occurs on image load
[onLoad="handlerText" ]> Code to execute on image load
Most of the attributes are optional; only a few are strictly necessary, as you can see in the following example:
<IMG NAME="dogImage"
SRC="i mages/dal mati f" ALIGN="MIDDLE">
18 Inserting Form Elements into l/our Web Page
See also Part IX for ideas on cool ways to adorn your Web pages with the < I MG> tag and other HTML multimedia morsels.
HTML comment: </-... ->
Try to strike a balance between over-commenting and not adding enough comments to your code. Over-commenting can actually make your code harder to read; on the other hand, not adding any comments at all makes other HTML or JavaScript authors have to guess what your code is doing (and why the coding is doing it!).
<!- This HTML file was created by Juan Valdez, 01/01/97
Two types of comments exist: HTML comments, which are demonstrated in the preceding code, and JavaScript comments, which look like this: V / or /* */. These comments are not interchangeable. If you try to use an HTML comment inside a JavaScript script, you get an error. If you try to use a JavaScript comment inside an HTML tag, your JavaScript comment shows up on the Web page!
For a good example of proper comment usage, see also “Getting Started with a Bare-Bones HTML Template,” in Part IX, or the “Comments” section in Part II.
A frame is a special kind of window. You can have several frames per “regular” window, and a user can scroll each frame independently. Each frame can also be associated with a separate URL. What fun! What possibilities! (And — potentially — what confusion!)
To create a frame in HTML, use these tags:
To access that frame in JavaScript, use this identifier: frames [0]
In the preceding JavaScript identifier, 0 is a number representing the order in which the frame was defined in the HTML code. The first frame is represented by 0; the second, by 1; the third, by 2; and so on.
Inserting Form Elements into J/our Web Page
Tag Syntax for a Frame Explanation
<FRAMESET Opening <FRAMESET> tag (group of frames)
R0WS="rowHei ghtLi st" Comma-separated list of values for row height
C0LS="columnWi dthLi st" Comma-separated list of values for column width
[onBlur="handlerText"] Code to invoke when frame is blurred (optional)
[onFocus="handlerText"] Code to invoke when frame receives focus (optional)
[onLoad*".handl erText" ] Code to invoke when frame is loaded (optional)
[onUnioad="handlerText"]> Code to invoke when frame is unloaded (optional)
[<FRAME Single <FRAME> tag (optional but recommended)
SRC="1 ocati onO.rURL" URL of the document that appears in this frame
NAME="frameName">] Internal name of frame (for coding purposes)
Previous << 1 .. 6 7 8 9 10 11 < 12 > 13 14 15 16 17 18 .. 72 >> Next