JavaScript: Difference between revisions

From MozillaZine Knowledge Base
Jump to navigationJump to search
m (minor rewording, added new article link)
Line 1: Line 1:
[[wikipedia:JavaScript | 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]]!
[[wikipedia:JavaScript | JavaScript]] is a programming language supported by many browsers which allows webpage 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 [http://developer.mozilla.org/en/docs/JavaScript_Console JavaScript Console].
Any errors that may occur when the browser tries to run JavaScript will appear in the [http://developer.mozilla.org/en/docs/JavaScript_Console JavaScript Console].
Line 10: Line 10:


==Advanced JavaScript settings==
==Advanced JavaScript settings==
These advanced settings are accessible when you enable JavaScript (see above) and, in Firefox, when you press the "Advanced" button. You can allow web page scripts to take certain actions by checking the appropriate boxes, or you can prevent the actions by unchecking these settings:
These advanced settings are accessible when you enable JavaScript (see above) and, in Firefox, when you press the "Advanced" button.   You can allow scripts on web pages to take certain actions by checking the appropriate boxes, or you can prevent the actions by unchecking these settings:


'''Move or resize existing windows''': Allows web pages to move or resize windows using scripts.
'''Move or resize existing windows''': Allows scripts to change the size or position of the existing window.
      
      
'''Raise or lower windows''':  Allows web page scripts to place windows on top of or underneath other windows.
'''Raise or lower windows''':  Allows scripts to place windows underneath or on top of other windows.


'''Disable or replace context menus''': Allows web pages to disable or replace context menus (right-click menus).
'''Disable or replace context menus''': Allows scripts to disable or change context (right-click) menus.
      
      
'''Hide the status bar''': Allows web pages to hide the status bar in popup windows.
'''Hide the status bar''': Allows scripts to hide the status bar, as in popup windows.


'''Change status bar text''': Allows web pages to replace the status bar web address (URL) with scrolling text.
'''Change status bar text''': Allows scripts 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 [https://bugzilla.mozilla.org/show_bug.cgi?id=239438].)
'''Change images''':  Allows scripts to change or animate images, as in image rollovers. '''Warning''': Unchecking this setting can make some webpage menus harder to navigate, disable features like zooming in and out of  maps or prevent some images from loading [https://bugzilla.mozilla.org/show_bug.cgi?id=239438].  (This option has been removed from the Advanced JavaScript Settings window in Firefox 1.5.)


==See also==
==See also==
[[Allowing only certain sites to use JavaScript]]
* [[Allowing only certain sites to use JavaScript]]
* [[Prevent websites from disabling new window features]]




[[Category:Page display]]
[[Category:Page display]]
[[Category:General concepts]]
[[Category:General concepts]]

Revision as of 14:27, 27 June 2006

JavaScript is a programming language supported by many browsers which allows webpage 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

These advanced settings are accessible when you enable JavaScript (see above) and, in Firefox, when you press the "Advanced" button. You can allow scripts on web pages to take certain actions by checking the appropriate boxes, or you can prevent the actions by unchecking these settings:

Move or resize existing windows: Allows scripts to change the size or position of the existing window.

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

Disable or replace context menus: Allows scripts to disable or change context (right-click) menus.

Hide the status bar: Allows scripts to hide the status bar, as in popup windows.

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

Change images: Allows scripts to change or animate images, as in image rollovers. Warning: Unchecking this setting can make some webpage menus harder to navigate, disable features like zooming in and out of maps or prevent some images from loading [1]. (This option has been removed from the Advanced JavaScript Settings window in Firefox 1.5.)

See also