Archive for March, 2008

JavaScript Programmer’s Reference Off-screen image caching (Useful tip) (Simple web server)

Friday, March 28th, 2008

JavaScript Programmer’s Reference Off-screen image caching (Useful tip) A technique for caching images locally in readiness for an animation. Refer to: Image preloading offscreenBuffering (Property) An alias for the window.offScreenBuffering property. Availability: JavaScript 1.2 JScript 3.0 Internet Explorer 4.0 Netscape 4.0 Property/method value type: Booleanor String primitive -myWindow.offScreenBuffering -myWindow.offScreenBuffering = aSetting -offScreenBuffering JavaScript syntax: -offScreenBuffering = aSetting Argument list: aSetting A new value to control this functionality Refer to: Window.offScreenBuffering OL object (Object/HTML) An object that represents the ordered list contained in an

    tag. Availability: DOM level 1 JavaScript 1.5 JScript 3.0 Internet Explorer 4.0 Netscape 6.0 Inherits from: Element object IE myOL = myDocument.all.anElementID IE myOL = myDocument.all.tags(”OL”)[anIndex] IE myOL = myDocument.all[aName] -myOL = myDocument.getElementById (anElementID) -myOL = myDocument.getElementsByName(aName) [anIndex] JavaScript syntax: -myOL = myDocument.getElementsByTagName (”OL”)[anIndex] 1606

O Off by one (Php web hosting) errors (Pitfall) Warnings:

Thursday, March 27th, 2008

O Off by one errors (Pitfall) Warnings: . Beware when you prefix decimal values with a zero character. You may want to justify a column of figures. If you add leading zero characters to a numeric string, if that string is subsequently parsed back to a numeric value, you may inadvertently export the value as a decimal but import it as an octal value. This can lead to an extremely difficult-to-diagnose fault in your software because the parsers sometimes add some intelligence and will correctly interpret the value as decimal if the characters 8 or 9 are present, but otherwise interpret it as octal notation. . This may be implementation-dependant behavior to some extent. . Be careful that you remove any leading zero characters from the text strings that you plan to convert using the numeric parser. The example shows a simple function for doing this. Example code: See also: Decimal value, Hexadecimal value, Integer constant, Number, Number.toString() Cross-references: ECMA 262 edition 3 section B.1 O’Reilly JavaScript Definitive Guide page 35 Off by one errors (Pitfall) An error caused by missing the target value by one. This kind of errors are caused by the following: . Forgetting than an index is zero-based and assuming it begins at 1. This typically affects arrays and strings. . Enumerating through a range of values and testing for equality with the target value rather than testing that you are still less than the target value. This is typically a problem when you build for loops. See also: Array index delimiter ([ ]), Array.slice(), do … while( … ), for( … ) …, Pitfalls, while( … ) … 1605

Web site management - JavaScript Programmer’s Reference The object space is defined

Wednesday, March 26th, 2008

JavaScript Programmer’s Reference The object space is defined by an extent rectangle that surrounds the space occupied by it on the screen. An extent rectangle is the smallest rectangle that completely encloses the item. This property specifies the width of that extent rectangle. Obsolescent (Definition) A feature of the language that is no longer supported. Warnings: . If you use obsolescent functionality, your script may fail when it is deployed on other platforms. See also: Deprecated functionality Octal value (Definition) A numeric value based on a radix of 8. Availability: ECMAScript edition 3 An octal value is an integer composed of only the following characters: 0 1 2 3 4 5 6 7 Octal values are always prefixed by a zero character. The sequence carries over for the next increment when each column reaches the value 7. Thus: 00 01 02 03 04 05 06 07 010 011 012 Octal values have a historical significance from having been used in the earliest computer systems. However these days, they are particularly useful since they map quite conveniently to the binary system. Each octal digit corresponds to three binary digits. The most significant of the three octal digits does not have a full range since it contains a carry over bit and a three digit octal number actually represents a 9 bit value. However, an 8 bit value can be encoded conveniently if the range is limited to 0377 as a maximum. Hexadecimal values map far more conveniently although they are harder to compute mentally. 0 0 0 0 0 0 0 0 0 0 0 0 1604

O OBJECT.useMap (Property) (Web hosting billing) OBJECT.useMap (Property) The URL

Wednesday, March 26th, 2008

O OBJECT.useMap (Property) OBJECT.useMap (Property) The URL of a defined hash element that defines a client-side image map. Availability: DOM level 1 JavaScript 1.5 Netscape 6.0 Property/method value type: String primitive JavaScript syntax: N myOBJECT.useMap This property reflects the value of the USEMAP=” “HTML tag attribute, which should refer to the named tag containing an image map. The reference is by means of a “#NAME” value in this property that corresponds to the NAME=” ” HTML tag attribute of the tag describing the image map to use with the object. OBJECT.vspace (Property) A vertical spacing above and below the with respect to its adjacent objects. Availability: DOM level 1 JavaScript 1.5 JScript 3.0 Internet Explorer 4.0 Netscape 6.0 Property/method value type: String primitive JavaScript syntax: -myOBJECT.vspace Margins placed around objects are either modified separately with all four margin sides having a different property or by adjusting the horizontal margins and vertical margins using just two values. The vspace property controls the margin at the top and bottom of the object. OBJECT.width (Property) The height of an area reserved for displaying the contents of the tag. Availability: DOM level 1 JavaScript 1.5 JScript 3.0 Internet Explorer 4.0 Netscape 6.0 Property/method value type: String primitive JavaScript syntax: -myOBJECT.width 1603

JavaScript Programmer’s Reference OBJECT.standby (Property) Sets or resets

Tuesday, March 25th, 2008

JavaScript Programmer’s Reference OBJECT.standby (Property) Sets or resets the message text displayed while the object is loading. Availability: DOM level 1 JavaScript 1.5 Netscape 6.0 Property/method value type: String primitive JavaScript syntax: N myOBJECT.standby OBJECT.tabIndex (Property) A control of where the OBJECTobject appears in the tabbing order of the page. Availability: DOM level 1 JavaScript 1.5 JScript 3.0 Internet Explorer 4.0 Netscape 6.0 Property/method value type: Number primitive JavaScript syntax: -myOBJECT.tabIndex This value indicates where in the tabbing sequence this object and any of its children will be placed. The tabbing order is used when filling in forms or moving focus. Pressing the [tab] key moves from one form element to the next according to the cascaded tabbing order defined by building a tree-like structure with the tab index values. OBJECT.type (Property) An indication of the MIME type of the object if its codeType property is undefined. Availability: DOM level 1 JavaScript 1.5 JScript 3.0 Internet Explorer 4.0 Netscape 6.0 Property/method value type: String primitive JavaScript syntax: -myOBJECT.type The MIME type of the object is accessible through the value of this property. Refer to the MIME type topic for details of the available MIME types you will likely see in this property. See also: MIME types 1602

O OBJECT.readyState (Property) OBJECT.readyState (Property) The current (Business web hosting)

Monday, March 24th, 2008

O OBJECT.readyState (Property) OBJECT.readyState (Property) The current status disposition of the tag as it is being loaded. Availability: JScript 3.0 Internet Explorer 4.0 Property/method value type: String primitive JavaScript syntax: IE myOBJECT.readyState This property reflects the loading status of an tag and its corresponding OBJECT object instantiation. Sometimes, you can design scripts to execute while the document is downloading. Inline scripts for example. At that time, you may even be able to trigger interval timed deferred executions as well. If it is important that the document has completed loading, you can check this property for one of the following values: uninitialized loading loaded interactive complete State Value The object is first instantiated but has not begun loading. The object has commenced loading. The object has completed loading. The object is loaded but not yet closed but is ready to handle interaction. The object body has been closed and the loading is finished. An object may not need to reflect the complete status before you can commence operating on it. Other objects may require that they are completely loaded. For example, you cannot create an OBJECT object that represents an tag until the has completed loading. This is because the ActiveX object construction requires a complete document body structure to attach itself to. Every time this readyState value changes, it triggers an onReadyStateChange event call-back. See also: onReadyStateChange Property attributes: ReadOnly. 1601

JavaScript Programmer’s Reference OBJECT.name (Property) The value of (Web site management)

Sunday, March 23rd, 2008

JavaScript Programmer’s Reference OBJECT.name (Property) The value of the NAME=” ” HTML tag attribute. Availability: DOM level 1 JavaScript 1.5 JScript 3.0 Internet Explorer 4.0 Netscape 6.0 Property/method value type: String primitive JavaScript syntax: -myOBJECT.name Objects are identified either by the NAME=” “HTML tag attribute or by the ID=” ” HTML tag attribute. Netscape shows a marginal preference for the name property while MSIE seems slightly better disposed towards the ID property. However in many cases, both browsers support either technique and in some cases will locate items named with either tag as if they existed in a single namespace. See also: NAME=” “, Namespace OBJECT.object (Property) An accessor that yields a reference to the containing JavaScript object when there is a possibility of naming conflicts between internally visible and externally visible property names. Availability: JScript 3.0 Internet Explorer 4.0 Property/method value type: Object object JavaScript syntax: IE myOBJECT.object If a property is a public property of the ActiveX object, and that name coincides with a property of the JavaScript object that is instantiated by the HTML tag, then access to the property belonging to the containing object is difficult. This is because the search order will see the public property of the ActiveX object first. By using the object property, once can access the containing object explicitly and retrieve a property of that object even if there is an identically named property belonging to the enclosed ActiveX object. This access mechanism applies to method invocations as well. See also: Applet.object Property attributes: ReadOnly. 1600

O OBJECT.height (Property) Property attributes: ReadOnly. OBJECT.height (Web design company)

Sunday, March 23rd, 2008

O OBJECT.height (Property) Property attributes: ReadOnly. OBJECT.height (Property) The height of an area reserved for displaying the contents of the tag. Availability: DOM level 1 JavaScript 1.5 JScript 3.0 Internet Explorer 4.0 Netscape 6.0 Property/method value type: Number primitive JavaScript syntax: -myOBJECT.height The object space is defined by an extent rectangle that surrounds the space occupied by it on the screen. An extent rectangle is the smallest rectangle that completely encloses the item. This property specifies the height of that extent rectangle. OBJECT.hspace (Property) A horizontal margin space either side of the tag with respect to its surrounding objects. Availability: DOM level 1 JavaScript 1.5 JScript 3.0 Internet Explorer 4.0 Netscape 6.0 Property/method value type: Number primitive JavaScript syntax: -myOBJECT.hspace Margins placed around objects are either modified separately with all four margin sides having a different property or by adjusting the horizontal margins and vertical margins using just two values. The hspace property controls the margin to the left and right of the object. 1599

JavaScript Programmer’s Reference OBJECT.data (Property) A URL that

Saturday, March 22nd, 2008

JavaScript Programmer’s Reference OBJECT.data (Property) A URL that points at a file containing data that the OBJECT element can access. Availability: DOM level 1 JavaScript 1.5 JScript 3.0 Internet Explorer 4.0 Netscape 6.0 Property/method value type: String primitive JavaScript syntax: -myOBJECT.data This is intended for passing in a URL that the ActiveX object can use to access some data service that is online and available for access via the network. It is not the URL of the ActiveX object itself. Property attributes: ReadOnly. OBJECT.declare (Property) A means of defining the object without activating it. Availability: DOM level 1 JavaScript 1.5 Netscape 6.0 Property/method value type: Boolean primitive JavaScript syntax: N myOBJECT.declare Declaring an OBJECT in this way may be useful when referring to the object from elsewhere in the page or from within another object. Sometimes you simply want to know something about it, perhaps one of its parameters. For video players, sometimes its useful to instantiate the OBJECT into the display without playing the video right away. OBJECT.form (Property) The form that an object belongs to if it is used for form input. Availability: DOM level 1 JavaScript 1.5 JScript 3.0 Internet Explorer 4.0 Netscape 6.0 Property/method value type: Form object JavaScript syntax: -myOBJECT.form 1598

O OBJECT.codeBase (Property) (Web site templates) OBJECT.codeBase (Property) The path

Friday, March 21st, 2008

O OBJECT.codeBase (Property) OBJECT.codeBase (Property) The path to the directory where the Java applet denoted by the CLASS=” ” HTML tag attribute is to be found. Availability: DOM level 1 JavaScript 1.5 JScript 3.0 Internet Explorer 4.0 Netscape 6.0 Property/method value type: String primitive JavaScript syntax: -myOBJECT.codebase The codebase is the path to the directory where the classes specified in the code property are located. The actual path to the required files is generated by a string concatenation of codebase+code to generate a fully specified URL. Due to security limitations it is not permitted to access a codebase value that is outside the domain specified by the containing document. There is conflicting information in the reference sources regarding the read/write ability of this property. Some suggest it is ReadOnlyand others suggest you can assign a value to it. It may be that you can assign a value to it without the JavaScript interpreter complaining but that any value you assign is ignored. OBJECT.codeType (Property) A description of the type of code in the object referred to by the CLASSID=” ” HTML tag attribute. Availability: DOM level 1 JavaScript 1.5 JScript 3.0 Internet Explorer 4.0 Netscape 6.0 Property/method value type: String primitive JavaScript syntax: -myOBJECT.codeType This is a MIME type value that describes the kind of code being embedded by the tag. There is conflicting information in the reference sources regarding the read/write ability of this property. Some suggest it is ReadOnly and other suggest you can assign a value to it. It may be that you can assign a value to it without the JavaScript interpreter complaining but that any value you assign is ignored. See also: MIME types 1597