JavaScript

From MozillaZine Knowledge Base
Jump to navigationJump to search

JavaScript is a programming language supported by many browsers which allows web page authors to have greater control over the user’s browsing experience. JavaScript is often used to create fly-out menus, invoke pop-up windows, validate form data and so on. Please note that JavaScript is not Java!

Any errors that may occur when the browser tries to run JavaScript will appear in the JavaScript Console.

Enabling JavaScript

Many web pages require JavaScript to work properly. To make sure that JavaScript is enabled in Firefox or Mozilla Suite, check these settings:

  • Firefox: "Tools -> Options -> Content (Web Features in Firefox 1.0.x) -> Enable JavaScript".
  • Mozilla Suite: "Edit -> Preferences -> Advanced -> Scripts & Plug-ins -> Enable JavaScript for -> Navigator"

(Note: The setting to enable JavaScript for the "Mail & Newsgroups" component is disabled by default, for security reasons.)

Advanced JavaScript settings

You can allow or prevent web page scripts from taking certain actions by checking or unchecking these options, found under "allow scripts to" in the advanced JavaScript settings. These settings are accessible when you enable JavaScript (see above) and, in Firefox, when you press the "Advanced" button:

Move or resize existing windows: Allows web pages to move or resize windows using scripts.

Raise or lower windows: Allows web page scripts to place windows on top of or underneath other windows.

Disable or replace context menus: Allows web pages to disable or replace context menus (right-click menus).

Hide the status bar: Allows web pages to hide the status bar in popup windows.

Change status bar text: Allows web pages to replace the status bar web address (URL) with scrolling text.

Change images: Allows images to be changed or animated, as in image rollovers or zooming in or out of maps. Warning: Unchecking this option can make some menus harder to navigate or prevent some images from loading. (This option has been removed from the Advanced JavaScript Settings window in Firefox 1.5 [1].)

See also

Allowing only certain sites to use JavaScript