JavaScript

来自WordPress中文文档
跳转至: 导航搜索

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 and Jscript is not JavaScript!

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, check these settings:

  • Firefox: "Tools -> Options -> Content -> Enable JavaScript".
  • Mozilla Suite/SeaMonkey: "Edit -> Preferences -> Advanced -> Scripts & Plug-ins -> Enable JavaScript for -> Navigator" (JavaScript is disabled by default for the "Mail & Newsgroups" component , for security reasons.)

If you have enabled JavaScript but it isn't working, make sure that JavaScript isn't being blocked by an extension like NoScript. Firewall programs or other security software can also include options that block JavaScript, such as the "Mobile Code Control" settings in ZoneAlarm Pro [1])

Advanced JavaScript settings

These advanced settings are accessible when you enable JavaScript (see above) and, in Firefox, when you click 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: (Mozilla Suite/SeaMonkey): Allows scripts to change or animate images, as in image rollovers. Warning: Do not uncheck this option! Unchecking "Change images" can prevent some images from loading, make some webpage menus harder to navigate and disable features such as zooming in and out of maps [2]. Note: The Advanced JavaScript Settings window in Firefox does not include a "Change images" option (it was removed in Firefox 1.5). If necessary, use about:config to reset the dom.disable_image_src_set preference to the default false value.

See also

External Links