JavaScript Basics Quiz II _ basics

Source: Internet
Author: User
Tags documentation

4. JavaScript limitations (javascript lminitations)

Q: What can JavaScript programs do?

A: JavaScript code can't do the following things:

    • You cannot use printers or other devices on the user's system or on the client's local area network.

      (workaround, see print JavaScript output.) )

    • You cannot access files directly on the user's system or on the client local area network; The only exception is a cookie file that can access the browser.

      (workaround, see the File Access section.) )

    • You cannot directly access files on a Web server.

      (workaround, see the File Access section.) )

    • Implement multiple processing or multithreading.

If you do need access to files or perform other "privileged" operations, you can use JavaScript in conjunction with Java applets. The signed Java applet allows privileged operations, while JavaScript can exchange information with the applet. However, you must understand that the biggest limitation of Javascript/java is that users may have been barred from using JavaScript or Java or both.

5. JavaScript-enabled browsers (Browsers supporting JavaScript)

Q: Which browsers support JavaScript?

A: JavaScript is supported in the following browsers:

    • Netscape Navigator (starting from 2.0)
    • Microsoft Internet Explorer (starting from 3.0)
    • Other vendors have licensed or implemented JavaScript interpreter browsers or products (such as opera).

See the version of JavaScript.

6. JavaScript version (JavaScript versions)

Q: What are the versions of JavaScript?

a: JavaScript is one of the emerging programming languages. It was realized for the first time that there was a Netscape community completed in 1995. The first browser to support JavaScript is the beta version of Netscape Navigator 2.0. By 1999, two major browsers, Netscape Navigator and Microsoft Internet Explorer, mainly supported the following versions of client javascript:

Browser

Year

JavaScript version

Netscape Navigator 2.0 1995 JavaScript 1.0
Microsoft Internet Explorer 3.0 1996 JavaScript 1.0 (JScript 1.0)
Netscape Navigator 3.0 1996 JavaScript 1.1
Netscape Navigator 4.0 1997 JavaScript 1.2
Microsoft Internet Explorer 4.0 1997 JavaScript 1.2 (JScript 3.0)
Netscape Navigator 4.5 1998 JavaScript 1.3
Microsoft Internet Explorer 5.0 1999 JavaScript 1.3 (JScript 5.0)

Unfortunately, Netscape and Microsoft's JavaScript implementations are different, and even the same version number of JavaScript is not the same. For example, JavaScript 1.0 in IE3 is different from the JavaScript 1.0 in Netscape Navigator 2; Similarly, JavaScript1.2 in IE4 and Netscape The JavaScript1.2 in Navigator4 is different.

In addition to these versions, third parties can create their own JavaScript implementations, or license Microsoft or Netscape's JavaScript technology. For example, opera browsers support JavaScript.

What does cross-platform coding mean? Essentially, you have to use one of the following techniques:

    • Use only a subset of the JavaScript languages supported by all browsers and/or
    • Write different code for different browsers and detect actual browsers at run time

7. JavaScript documentation (JavaScript documentation)

Q: Where do I get the JavaScript documentation?

A: Online JavaScript documents can be found from these sites:

    • http://www.mozilla.org/js/language/-mozilla.org JavaScript resource page.
    • JScript for Development tools and Language sections in the Http://msdn.microsoft.com/en-us/library/72bd815a.aspx-MSDN library.
    • Http://msdn.microsoft.com/en-us/library/hbxc2t98.aspx-MSDN in web development and scripting in the library.

Alternatively, you can find JavaScript discussions, online guides, links, code samples, and hundreds of useful scripts from the following sites (this list is not entirely, however, a starting point):

    • http://www.WebReference.com/programming/JavaScript/-Guide and deep discussion.
    • http://www.irt.org-several different FAQs, including JavaScript.
    • Http://www.JavaScripts.com-Many scripts and code examples.
    • http://www.JavaScripter.net/faq/-this FAQ.

8. Print JavaScript outputs (Printing JavaScript output)

Q: How do i print JavaScript output?

A: JavaScript programs do not have direct access to the printer. However, you can print (or use a shortcut key, or Ctrl + P on Windows) from a file in the browser menu, and the user prints anything on the page, including the output of the JavaScript program.

If the user needs to print your script output frequently, then you can:

    • Prompt them to use the file | Print menu and/or
    • Use the Window.print () method to open the Print window.

In addition, your script can produce printed content in a separate browser window (see the following example).

Example : This script produces a multiplication table, prints it to a new browser window, and explains how to print to the user.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.