Archive for January, 2008

Web hosting top - JavaScript Programmer’s Reference Cross-references: Wrox Instant JavaScript

Thursday, January 24th, 2008

JavaScript Programmer’s Reference Cross-references: Wrox Instant JavaScript page 64 Netscape Navigator (Web browser) One of the two major web browser platforms. Netscape has made the source of the Communicator product available (which includes the Navigator browser). You can download this from the Netscape web site and participate in the development of the browser project. Netscape 6.0 is only just released for public use but is likely to contain some bugs. We refer to this browser consistently as Netscape regardless of whether you are running Communicator or any other packaged version. Here is a brief guide to versions of Netscape vs. JavaScript: Version JavaScript 2.0 3.0 4.0 to 4.05 4.06 to 4.75 5.0 6.0 JavaScript 1.0 JavaScript 1.1 JavaScript 1.2 JavaScript 1.3 JavaScript 1.4 JavaScript 1.5 Note that version 5.0 never shipped although if you search on the web you can find some installable binaries may satisfy your curiosity regarding browser history. Some reports suggest that those version 5.0 browsers only supported JavaScript 1.3. Because Mozilla is factored into components, it s feasible that you could build any version of the browser with whatever version of JavaScript you want. Many values that Netscape exposes as JavaScript properties reflect the value of an HTML tag attribute. Likewise, many of its special objects are counterparts to the HTML tags. However it does not map objects so completely or consistently to HTML tags as the MSIE browser. Nor does it support the attributes and style mechanisms as elegantly. Where the information is available, we have indicated the version number of JavaScript (or JScript) when HTML tags and attributes became accessible as objects or properties. In many cases, this may be a later version than when the instantiating HTML tag or attribute was first supported by the browser. We constructed many scripts to inspect and enumerate the various properties of the objects in the MSIE and Netscape browsers. These uncovered many object types and properties that were hitherto undocumented. They might have been available in earlier versions of the browser. However, where language elements were discovered for the first time, they are initially documented as being available from version 4 of Netscape. A limited amount of further testing was applied where it was suspected that language elements may have been available in earlier releases and the availability modified accordingly. 1516

N Netscape Enterprise Server (Product) You may (Virtual web hosting)

Thursday, January 24th, 2008

N Netscape Enterprise Server (Product) You may also be able to obtain admin tools from Netscape and Microsoft to carry out legitimate customizations on the browsers before deploying them throughout your organization. This can be called from JavaScript by setting the location.href of a window to a valid nethelp: location. Here are some examples: URL Description nethelp:netscape/home:start_here Front page of the help system nethelp:netscape/collabra:HELP_SEC_CERTS_CRYPTOMODS Security help nethelp:netscape/collabra:HELP_SEC_CERTS_ISSUERS Security help nethelp:netscape/collabra:HELP_SEC_INFO Security help nethelp:netscape/collabra:HELP_SEC_PASS_UNSET Security help nethelp:netscape/collabra:HELP_SEC_PREFS_APPLET Security help nethelp:netscape/collabra:HELP_SEC_PREFS_MESSENGER Security help nethelp:netscape/collabra:HELP_SEC_PREFS_NAVIGATOR Security help Mostly, these special URLs will be useful for debugging. Getting details of the disk cache for example may be useful. Pulling up the JavaScript debugger page if you detect an error in your script might also be a cool trick. This appears to have changed somewhat in Netscape 6.0, which is likely to provide a whole range of new possibilities. Once the browser is fully debugged and working we can spend many happy hours inspecting it to discover them. Warnings: . This is not present in MSIE at all. It displays help using a completely different mechanism altogether. See also: about: URL, javascript: URL, mailbox: URL, mailto: URL, URL Netscape Enterprise Server (Product) A web server that supports JavaScript on the server side. Server-side scripting is accomplished by enclosing the JavaScript code inside tags in the HTML. These will be parsed out as the pages is processed and sent onwards. They will be replaced by the output of the script enclosed in the tags. The main difference is that where you might have used a document.write() method in the client-side script, on the server side, you use a write() method. If the tag remains intact and is forwarded in the document sent onwards to the browser, the browser should ignore it. However, this could give away much valuable information about the inside of the server and middle-ware. That could aid the wily hacker in an intrusion attack. See also: blob object, client object, Connection object, Cursor object, database object, DbPool object, File object, Lock object, project object, request object, response object, ResultSet object, SendMail object, server object, Stproc object 1515

JavaScript Programmer’s Reference Which is equivalent (Web design programs) to: anOperand

Wednesday, January 23rd, 2008

JavaScript Programmer’s Reference Which is equivalent to: anOperand = anOperand * -1 And also: anOperand = 0 - anOperand Although this is classified as a unary operator, its functionality is really that of an additive operator. The associativity is from right to left. Refer to the Operator Precedence topic for details of execution order. See also: Add (+), Additive expression, Additive operator, Associativity, Decrement value (-), Operator Precedence, Subtract (-), Unary operator Cross-references: ECMA 262 edition 2 section 11.4.7 ECMA 262 edition 3 section 11.4.7 NES (Product) An abbreviation for Netscape Enterprise Server. Refer to: Netscape Enterprise Server nethelp: URL (Request method) A special URL access mode for Netscape help screens. Availability: JavaScript 1.2 Netscape 4.0 This is a special request method provided by the Netscape browser to gain access to local client- side help resources. The resources are loaded from files that live in a help folder within the folder containing the browser application. You can access the files with a text editor and study how they work. They are just plain HTML and JavaScript; however, they provide a quite helpful embedded help system. In a large enterprise where you control the deployment of the browsers, you may want to augment the browser help with some internal help pages. You might want to add details of your help desk and how to contact it for instance. These special URLs are not present in MSIE although there will be some internal resources in that browser that may provide customization opportunities in a similar way. Indeed, Microsoft provides an administrator kit which you can use to customize the browser installation. 1514

Web hosting compare - N Navigator.userProfile (Property) Navigator.userProfile (Property) This yields

Tuesday, January 22nd, 2008

N Navigator.userProfile (Property) Navigator.userProfile (Property) This yields a user profile object in MSIE browsers. Availability: JScript 3.0 Internet Explorer 4.0 Property/method value type: UserProfile object JavaScript syntax: IE navigator.userProfile User profiles are available only on MSIE. The same arguments regarding uninvited modification and possible knock-on effects apply here just as much as they do to Netscape. Even though the scripting techniques may be different, the consequences may be similar. See also: vCard object Property attributes: ReadOnly. Negation operator (-) (Operator/unary) Negate an operand’s value. 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: Number primitive JavaScript syntax: –anOperand Argument list: anOperand A numeric value that can be negated The operand is evaluated and converted to a numeric value. The result is negated. A positive value becomes negative and a negative value becomes positive. This is functionally equivalent to: anOperand *= -1 1513

JavaScript Programmer’s Reference return “ie”; } return “other”; (Web site traffic)

Monday, January 21st, 2008

JavaScript Programmer’s Reference return “ie”; } return “other”; } alert(getBrowserType()); See also: server.agent Property attributes: ReadOnly. Navigator.userLanguage (Property) An MSIE specific language property. JScript 3.0 String primitive Availability: Internet Explorer 4.0 Property/method value type: JavaScript syntax: IE navigator.userLanguage This property describes the user-selected language code. It uses the same language values as the navigator.language property. Refer to the Language codes topic for a list of the available codes. Warnings: . Note that some platforms will yield a language and country code while others may only yield a language code. See also: Element.lang, ISO 3166, Language codes, Navigator.language, Navigator.systemLanguage Property attributes: ReadOnly. 1512

Web hosting unlimited bandwidth - N Navigator.userAgent (Property) . While this will

Monday, January 21st, 2008

N Navigator.userAgent (Property) . While this will only affect the user of the browser when they run your script, the nature of the userAgent string may cause your script to fail. . The following unusual values have been encountered in userAgent strings: . - Null characters . - Control characters . - URL strings . - HTML . - C-Code . - JavaScript . - GIF image data . - Very large text blocks . These appear to be intended to cause server difficulties and possibly malfunctions in logging analysis systems. They may, as a side effect, cause your script to crash and burn too. Example code: // A function to normalize the user agent string function getBrowserType() { var myUserAgent; var myMajor; myUserAgent = navigator.userAgent.toLowerCase(); myMajor = parseInt(navigator.appVersion); if( (myUserAgent.indexOf(’mozilla’) != -1) && (myUserAgent.indexOf(’spoofer’) == -1) && (myUserAgent.indexOf(’compatible’) == -1) && (myUserAgent.indexOf(’opera’) == -1) && (myUserAgent.indexOf(’webtv’) == -1)) { if (myMajor > 4) { return “nav6″; } if (myMajor > 3) { return “nav4″; } return “nav”; } if (myUserAgent.indexOf(”msie”) != -1) { if (myMajor > 4) { return “ie5″; } if (myMajor > 3) { return “ie4″; } 1511

Web site construction - JavaScript Programmer’s Reference This method is only supported

Sunday, January 20th, 2008

JavaScript Programmer’s Reference This method is only supported in order to prevent scripts from crashing. The data-tainting support was a short-lived means of sending data back to a server. The security implications became unworkable and the whole data-tainting idea was deprecated. The functionality was removed in JavaScript version 1.2. If you encounter this method in a script you are maintaining, you should seek to remove it to prevent run-time errors in the future. If a browser implements this at all, it should return the value false for this method. Some earlier Netscape browsers may not. This functionality is highly deprecated and you can expect it to cause run-time exceptions in future. Warnings: . DO NOT USE THIS FACILITY! See also: taint(), untaint() Navigator.userAgent (Property) The identifying string for this browser. Availability: JavaScript 1.0 JScript 1.0 Internet Explorer 3.02 Netscape 2.0 Opera 3.0 Property/method value type: String primitive JavaScript syntax: -navigator.userAgent This string is returned to a web server in the USER-AGENT:header of an HTTP request. This is often logged and processed to analyze the distribution of browser types across the user base for a site. The userAgent string contains much useful information and generally includes everything the appVersion and appName properties would have told you as well. Here are some typical values: . Mozilla/4.7 (Macintosh; I; PPC) . Mozilla/4.0 (compatible; MSIE 4.5; Mac_PowerPC) . Mozilla/4.0 (compatible; MSIE 5.0; Mac_PowerPC) Warnings: . Beware that some customized browsers will encode a variety of strange textual values into their userAgent property. 1510

N Navigator.systemLanguage (Property) Property attributes: ReadOnly. Navigator.systemLanguage (Vps web hosting)

Saturday, January 19th, 2008

N Navigator.systemLanguage (Property) Property attributes: ReadOnly. Navigator.systemLanguage (Property) An MSIE-specific language property. Availability: JScript 3.0 Internet Explorer 4.0 Property/method value type: String primitive JavaScript syntax: IE navigator.systemLanguage This property describes the system-specified language and country code. It uses the same language values as the navigator.language property. Refer to the Language codes topic for a list of the available codes. The most likely default value you will encounter will be “en” which signifies English but does not make distinction between UK and US variants. The value is supposed to be case-insensitive. Warnings: . Note that some platforms will yield a language and country code while others may only yield a language code. See also: Element.lang, ISO 3166, Language codes, Navigator.language, Navigator.userLanguage Property attributes: ReadOnly. Navigator.taintEnabled() (Method) This feature is no longer recommended. It is part of a now defunct security mechanism. Availability: JavaScript 1.1 JScript 3.0 Internet Explorer 4.0 Netscape 3.0 Opera 3.0 Deprecated JavaScript syntax: -navigator.taintEnabled() 1509

JavaScript Programmer’s Reference Warnings: . You cannot access (Web file server)

Saturday, January 19th, 2008

JavaScript Programmer’s Reference Warnings: . You cannot access this method unless the script has the UniversalPreferencesRead privilege. Setting preferences requires the UniversalPreferencesWrite privilege. See also: UniversalPreferencesRead, UniversalPreferencesWrite Web-references: http://developer.netscape.com/library/documentation/deploymt/jsprefs.htm Navigator.savePreferences() (Method) Save the preference values for the current user. JavaScript 1.2 navigator.savePreferences() Availability: Netscape 4.0 JavaScript syntax: N Any access to the preferences mechanisms in a browser for any purpose other than reading them should be treated with some suspicion. It may be preferable to invite the user to adjust a preference setting rather than to modify it for them. You might affect the behavior of other pages inadvertently. Warnings: . In Netscape, your script needs to be granted the UniversalPrefrencesWrite privilege before this call can be executed successfully. See also: UniversalPreferencesWrite Navigator.securityPolicy (Property) An indication of the current security policy settings. JavaScript 1.4 String primitive Availability: Netscape 4.7 Property/method value type: JavaScript syntax: N navigator.securityPolicy This property contains the current security policy settings. Examining this property in a browser session yields the value “Export policy”. Warnings: . This yields the undefined value in MSIE for Macintosh. 1508

N Navigator.preference() (Method) . There is additional

Friday, January 18th, 2008

N Navigator.preference() (Method) . There is additional confusion in that there is a plugins[] array that belongs to the document and another than belongs to the navigatorobject. They both contain collections of objects but of different types. This is further confused by the fact that the document.plugins[] array is another name for the document.embeds[] array. . To help clarify this confusing situation, the best recommendation is that we refer to document.embeds[] and navigator.plugins[]and quietly ignore the document.plugins[]array. Furthermore we shall refer to Plugin objects as being something the browser can use to play embedded content and Embed objects will be an instance of a plugin that is alive and running in a document. Example code: See also: Plugin object, PluginArray object Property attributes: ReadOnly. Navigator.preference() (Method) A mechanism for allowing signed scripts to set a preference value in Netscape . Availability: JavaScript 1.2 JScript 3.0 Internet Explorer 4.0 Netscape 4.0 -navigator.preference() -navigator.preference(aName) JavaScript syntax: -navigator.preference(aName, aValue) aName The name of a preference Argument list: aValue A new value to store in a preference This is not portable but may be necessary in some captive intranet situations where you know what the target client is going to be and have some control over it. Although the method appears to be widely available, the values for specifying user preferences certainly have not been standardized and the security implications are also not common to all the platforms. You should be prepared to write some portability support code if you plan to deploy this functionality. 1507