Archive for January, 2008

Cool web site - JavaScript Programmer’s Reference ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE,

Thursday, January 31st, 2008

JavaScript Programmer’s Reference ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE appendChild(), cloneNode(), hasChildNodes(), insertBefore(), removeChild(), replaceChild() Class constants: Object methods: Collections: Here is a list of the available node types: attributes[], childNodes[] Constant Type Description undefined null A member of the attributes collection ELEMENT_NODE 1 HTML element object node ATTRIBUTE_NODE 2 HTML tag attribute object TEXT_NODE 3 Text object node CDATA_SECTION_NODE 4 CDATA section ENTITY_REFERENCE_NODE 5 Entity reference ENTITY_NODE 6 Entity node PROCESSING_INSTRUCTION_NODE 7 Processing instruction node COMMENT_NODE 8 Comment node DOCUMENT_NODE 9 Document object DOCUMENT_TYPE_NODE 10 Doctype object DOCUMENT_FRAGMENT_NODE 11 Document fragment node NOTATION_NODE 12 Notation node The DOM level 2 specification adds the following methods: . supports() . normalize() It also adds the following properties: . namespaceURI . prefix . localName At DOM level 3, the interface to the Node object is expected to evolve further to allow nodes to be compared and to be able to extract a serialized version of a DOM tree branch into a string primitive. This functionality is still under review as this is being written. The following additional properties are expected to be supported: . baseURI . textContent . key 1526

Web hosting script - N news: URL (Request method) Warnings: .

Wednesday, January 30th, 2008

N news: URL (Request method) Warnings: . There are significant security and virus related risks with JavaScript enabled news. The possibilities are so catastrophic that the best reccomendation is to deactivate JavaScript and Java in any news- reading client application. . Just because something is possible does not mean it is advisable or good to do. . On the other hand, within the confines of a closely controlled intranet or workgroup, this could find many useful applications. Just so long as you know where the news posts came from and you can absolutely trust that they have not been compromised. . Personally, I’d recommend that you turn it off. It might be useful for including the odd diagram but mostly you need to get the informational content and it doesn’t really need to be very pretty. See also: E-mail containing JavaScript Cross-references: Wrox Instant JavaScript page 60 news: URL (Request method) A request from a web browser to a news server to send a document. Use the browser to download and browse some news content. Warnings: . This is only allowed under script control if the script has the UniversalSendMail privilege. See also: javascript: URL, UniversalSendMail, URL Node object (Object/DOM) A node is the primary component from which documents are built (in the context of a DOM hierarchy). Availability: DOM level 1 JavaScript 1.5 JScript 5.0 Internet Explorer 5.0 Netscape 6.0 JavaScript syntax: -myNode = myMutationEvent.relatedNode Object properties: firstChild, lastChild, nextSibling, nodeName, nodeType, nodeValue, ownerDocument, parentNode, previousSibling 1525

JavaScript Programmer’s Reference A line break is also (Free web hosting with ftp)

Wednesday, January 30th, 2008

JavaScript Programmer’s Reference A line break is also introduced when you use block structured elements in the HTML. Here is a list of common HTML tags that do this (there are others too): .

. .
.
.
.
.
.

etc .
. .
  • . .
      .

      .

        . 
        See also: Pitfalls Cross-references: Wrox Instant JavaScript page 46 News posts containing JavaScript (Advice) You can embed JavaScript into news postings composed using HTML. When you compose and post a news message, you may use HTML as a way to improve the presentation. This means you can include some JavaScript to be executed in the client mail- reader application. Not all news-reading clients can support HTML let alone JavaScript. However, if your recipient does (and that is likely if its a web browser), then you can do some creative things to link topics in threads and pre-format replies so that they associate correctly into the news topic tree. You simply construct your HTML document in the normal way. 1524

        N Newline (Escape sequence) (Web site translator) Cross-references: ECMA 262

        Tuesday, January 29th, 2008

        N Newline (Escape sequence) Cross-references: ECMA 262 edition 2 section 11.2.2 ECMA 262 edition 2 section 11.2.4 ECMA 262 edition 2 section 15 ECMA 262 edition 3 section 11.2.2 Wrox Instant JavaScript page 15 Wrox Instant JavaScript page 21 Newline (Escape sequence) A means of introducing line breaks into string content texts. Availability: ECMAScript edition 2 The newline escape sequence n can be placed in string literals if you want to break the output text over more than one line. Warnings: . Do not use a line terminator even with a backslash to escape it. In other words, don’t think that placing a backslash as the last character of a line will hide the line terminator. While that may work in other languages, it won’t work in JavaScript. See also: Escape sequence (), Line terminator Cross-references: ECMA 262 edition 2 section 7.2 ECMA 262 edition 2 section 7.7.4 ECMA 262 edition 3 section 7.3 Newlines are not
        tags (Pitfall) A newline in a script does not display a line break in HTML output. Because HTML is fairly freely formatted, you have to explicitly tell it when a line break is to appear. You can do this a variety of block-level tags. Its most likely done with a
        or

        tag. When you use the document.write() method, you need to explicitly include the necessary
        or

        tags otherwise the HTML output that gets displayed will all run onto a single line. Placing a nnewline escape into the output may make the HTML source look nice but it won’t affect the displayed output. 1523

        JavaScript Programmer’s Reference new (Operator/unary) (Web design software) An object construction

        Monday, January 28th, 2008

        JavaScript Programmer’s Reference new (Operator/unary) An object construction operator. Availability: ECMAScript edition 2 JavaScript 1.0 JScript 1.0 Internet Explorer 3.02 Netscape 2.0 Netscape Enterprise Server 2.0 Opera 3.0 Property/method value type: An object whose type depends on the constructor -myObject = new aConstructorJavaScript syntax: -myObject = new anObject(someArguments) aConstructor An object constructor function anObject An object to clone Argument list: someArguments A collection of initial values for the new instance The new operator creates a new instance of the object it is operating on. As the object is created, the receiver’s Construct method is called with no arguments passed to it. Any initialization is only carried out by the Construct method. The associativity is from right to left. Refer to the operator precedence topic for details of execution order. Typically this would be used to instantiate core objects of the following types: . Array . Boolean . Date . Function . Number . Object . RegExp . String This can also be used to instantiate some host objects. See also: Array(), Associativity, Boolean(), Date(), Function(), Left-Hand-Side expression, List type, Number(), Object(), Operator Precedence, RegExp(), String() 1522

        N netscape.security.PrivilegeManager (Java class) netscape.security.PrivilegeManager (Java class) (Web server setup)

        Monday, January 28th, 2008

        N netscape.security.PrivilegeManager (Java class) netscape.security.PrivilegeManager (Java class) Part of the Netscape security model implemented with Java. Availability: JavaScript 1.1 Netscape 3.0 Class properties: EQUAL, NO_SUBSET, PROPER_SUBSET, SIGNED_APPLET_DBNAME, TEMP_FILENAME, theDebugLevel Class methods: checkPrivilegeEnabled(), checkPrivilegeGranted(), disablePrivilege(), enablePrivilege(), enableTarget(), getMyPrincipals(), getPrivilegeManager(), getSystemPrincipal(), revertPrivilege() Object methods: disablePrivilege(), enablePrivilege(), getPrivilegeTableFromStack() Because the Netscape security model is based on the Java security model, the Netscape browser requests its privileges through the Java mechanisms. These are encapsulated in a class that you can access from inside JavaScript. The downside of this is that there is no meaningful value returned when the request is made. If the request for a privilege is denied, the error causes a Java exception, which is difficult to trap from JavaScript. It is possible that more recent browser versions will support an exception- handling mechanism. PrivilegeManager object, Requesting privileges, UniversalBrowserAccess, UniversalBrowserRead, UniversalBrowserWrite, UniversalFileRead, UniversalPreferencesRead, UniversalPreferencesWrite, UniversalSendMail See also: Method JavaScript JScript N IE Opera Notes disablePrivilege() 1.1 + 3.0 + - enablePrivilege() 1.1 + 3.0 + - getPrivilegeTable FromStack() 1.1 + 3.0 + - 1521

        Web design - JavaScript Programmer’s Reference netscape.plugin.Plugin (Java class) A special

        Sunday, January 27th, 2008

        JavaScript Programmer’s Reference netscape.plugin.Plugin (Java class) A special class for encapsulating plugins so they present a common API. This is a shortcut to the Packages.netscape.plugin.Plugin class. Availability: JavaScript 1.1 Netscape 3.0 HTML syntax: Object methods: destroy(), equals(), getClass(), getPeer(), getWindow(), hashCode(), init(), isActive(), notify(), notifyAll(), toString(), wait() See also: , LiveConnect, Plugin object Method JavaScript JScript N IE Opera Notes destroy() 1.1 + 3.0 + - equals() 1.1 + 3.0 + - getClass() 1.1 + 3.0 + - getPeer() 1.1 + 3.0 + - getWindow() 1.1 + 3.0 + - hashCode() 1.1 + 3.0 + - init() 1.1 + 3.0 + - isActive() 1.1 + 3.0 + - notify() 1.1 + 3.0 + - notifyAll() 1.1 + 3.0 + - toString() 1.1 + 3.0 + - wait() 1.1 + 3.0 + - netscape.security (Java package) The top of a hierarchy of Java packages that provide security facilities. This is a shortcut to the Packages.netscape.security package. Availability: JavaScript 1.1 Netscape 3.0 See also: Security policy, JavaPackage object 1520

        Web server version - N netscape.javascript.JSObject (Java class) netscape.javascript.JSObject (Java class)

        Saturday, January 26th, 2008

        N netscape.javascript.JSObject (Java class) netscape.javascript.JSObject (Java class) The full definition of the JSObject class for encapsulating JavaScript objects in Java. A shortcut to the Packages.netscape.javascript.JSObject class. Availability: JavaScript 1.1 Netscape 3.0 Class methods: getWindow() Values of this type are visible to JavaScript as the encapsulated object that was originally passed to Java. Effectively, the wrapper is removed. Note that you cannot use this as a constructor. There wouldn’t be any point anyway because you can create JavaScript objects within the JavaScript environment; there is no need to go through the Java bridge to accomplish that. See also: Java calling JavaScript, Java to JavaScript values, JavaScript to Java values, JSObject object netscape.lck (Java package) A configuration file as used in older versions of Netscape. Not to be confused with Packages.netscape. Availability: JavaScript 1.1 Netscape 3.0 This is provided as support for preference management in older versions of Netscape. Preferences See also: Cross-references: Wrox Instant JavaScript page 59 netscape.plugin (Java package) The top of a hierarchy of Java packages that support plugins. This is a shortcut to the Packages.netscape.plugin package. Availability: JavaScript 1.1 Netscape 3.0 Refer to: JavaPackage object 1519

        JavaScript Programmer’s Reference netscape.applet (Java package) The root (Web hosting account)

        Saturday, January 26th, 2008

        JavaScript Programmer’s Reference netscape.applet (Java package) The root node of the Java hierarchy where the applets are built. A shortcut to the Packages.netscape.applet package. Availability: JavaScript 1.1 Netscape 3.0 This property returns a Java package that is encapsulated inside a JavaScript object belonging to the JavaPackage class. You need to know quite a lot about the underlying Java objects to make use of this because the properties and methods it supports are not exposed in an enumerable fashion. This means you would have difficulty in writing a JavaScript inspector to examine these objects. See also: JavaPackage object netscape.cfg (Java package) A new style configuration file for Netscape. Not to be confused with the Packages.netscape Java classes. Availability: JavaScript 1.1 Netscape 3.0 See also: netscape.lck, Preferences netscape.javascript (Java package) A Java package for supporting JavaScript inside Java. A shortcut to the Packages.netscape.javascript package. Availability: JavaScript 1.1 Netscape 3.0 Refer to: JavaPackage object 1518

        N netscape (Java (Ipower web hosting) package) Version 5 of

        Friday, January 25th, 2008

        N netscape (Java package) Version 5 of Netscape was scrapped because its codebase became too unwieldy to work with. There seems little point in documenting its peculiarities. Netscape version 6.0 was in beta trials and until PR3 was so unstable and crash-prone that most of our testing bore little fruit. Right at the point where content was being finalized for publication Netscape 6.0 was released as a final product. It is clearly still a work in progress and there are quite a few non-working components. It looks good though. The potential for exercising the DOM standard document navigation is really exciting. There is a great deal yet to discover about the new browser and it will stabilize as bugs get fixed and new releases are shipped. Perhaps browser versions may become less important as they converge on a single standard benchmark of functionality. For the time being, current practice suggests that version 4 browsers of both traditions are rapidly being taken over by version 5 MSIE browsers. Version 2 and 3 of MSIE and Netscape have declined to such small usage levels as to not require any further serious attempts to support them on new projects. Netscape 6.0 may win back some market share but only if its bugs are fixed quickly. Version 6.0 of MSIE is about to go to beta testers and the standards bodies are still some way ahead of the browser manufacturers so there is a long way to go yet. Warnings: . Netscape 2.02 does not cope gracefully with dollar signs in identifier names. See also: Identifier, Platform, Script execution, Undocumented features, Web browser Cross-references: Wrox Instant JavaScript page 14 Web-references: http://www.mozilla.org/ http://www.netscape.com/ http://home.netscape.com/browsers/6/index.html netscape (Java package) A short-cut reference to the Packages.netscape object. It allows JavaScript to access the Java class hierarchy to instantiate Java objects. JavaScript 1.1 Netscape 3.0 Netscape Enterprise Server 2.0 Availability: Property/method value type: JavaScript syntax: JavaPackage netscape N N N N myWindow.netscape myWindow.Packages.netscape netscape Packages.netscape See also: Window.java, Window.netscape, Window.Packages, Packages.netscape 1517