Getting Started with JavaScript (iii) __java

Source: Internet
Author: User
1.2. What is JavaScript?

The predecessor of JavaScript was LiveScript, but Netscape later changed its name to JavaScript, probably due to the excitement of Java. This name often confuses people, because although Java and JavaScript have some similar syntax, there is no inevitable connection between them.

Java is compared to JavaScript as a car relative to a carpet (carpet).

--javascript discussion group from Usenet (a worldwide newsgroup network system)

Netscape created JavaScript in 1996, which is contained in the Netscape Navigator (NN) 2.0 browser and uses an interpreter to read and execute JavaScript code added to the. html page. Since then, the steady growth of this language has become more and more popular, and now most browsers support it.

The good news is that this means that Web pages that use JavaScript can be parsed by all major browsers. Another message is less beautiful, and that is, different browsers differ in how they implement JavaScript, although the JavaScript language is the same. However, JavaScript can be turned off by the user-and some companies and organizations require their users to do so from a security perspective. This we will briefly discuss further and also throughout the book.

The big thing about JavaScript is that once you learn how to use it in your browser programming, you can apply it to other areas. Microsoft's servers-iis-use JavaScript to do server-side programming (ASP), PDF files now use JavaScript, and even the task management of Windows can use JavaScript to move from run. Many applications, such as Dreamweaver and Photoshop, are scripted using JavaScript. Many plug-ins on the operating system, such as Apple's dashboard or the Konfabulator of Linux and Windows platforms, even allow you to write small helper programs using JavaScript.

Google Maps is one of many big companies that have recently provided APIs (application programming interfaces) that you can use JavaScript objects and methods on your own web pages. You can use just a few lines of code to provide scalable and scrolling maps on your site.

Another better feature is that JavaScript is easier to develop than advanced programming languages and server-side programming languages. It doesn't need to be compiled like Java and C + +, and it doesn't need to run on the server like Perl, PHP, or Ruby, or it needs to be executed on the command line. All you need to do is use a text editor and browser to write, execute, debug, and apply JavaScript scripts, both of which are already available in all operating systems. Of course, there are tools to make this easier for you, such as Mozilla Venkman, Microsoft Script Debugger, and Kjscmd JavaScript debugger.

1.3. JavaScript issues and legal rights

As I mentioned at the beginning of this chapter, JavaScript has been a complete part of web development in the past few years, but it has also been used for improper purposes. As a result, it left a bad name. The reason for this result is the outrageous JavaScript effects, such as moving page elements and pop-up windows. You may be impressed by this, the first time you see them but quickly turn into another page, and sometimes even pop up a lot of windows so that you don't want to open the window again. Many of the similar effects are from DHTML (more in chapter three).

The term User agent and the lack of understanding of what a user agent is is also a problem. Typically, a user agent refers to a browser, such as Microsoft Internet Explorer (MSIE), Netscape,mozilla (Moz), Firefox (Fx), opera, or Safari. However, the browser is not the only user agent on the web. The other include:

• Assistive technology to help users overcome their flaws-such as text-reading software or a blind display

L Plain Text web browser, like Lynx

L Web-activated applications

L Game console

L Mobile phone/cellular phone

L Handheld cell phone (PDAs)

L Interactive TV set-top box

L Search engines and other retrieval programs

l More of the other

So many types of user agents, using different technical tools (some old user agents are not updated), is also a great danger for JavaScript.

Not all visitors to your site will be able to experience the effects you apply, and many will turn the JavaScript feature off for security reasons. JavaScript can be used both to do good and to do bad things. If the operating system (such as Windows without patches) allows, you can use JavaScript to install a virus or Trojan horse on a computer or read the user's information and then send it to another server.

Note: There is no way to know what tools the visitor is using or the function of its computer. Furthermore, you never know what your visitors ' experiences and abilities are. This is also a good aspect of the web---everyone can participate. Then, this can bring unexpected results to JavaScript programmers.

In most cases, you may want a server-side alternative. It can test whether the user agent supports the required functionality, and if not, the server uses its alternative.

The Independent scripting language is a statutory requirement for the Web site, which is defined in the Commonwealth's Digital Discrimination Act, Section 508 of American law and other regional laws in the world. This means that if you develop a site without JavaScript

Can not be used, or your JavaScript effects require users to have a certain ability or their user agent does not work, your client will be able to sue you for discrimination.

However, JavaScript is neither evil nor useless, and it is a great tool that can help users surf on your site, feel smoother and take less time.

 

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.