My first JavaScript program--alert Why can't I play the data? __javascript

Source: Internet
Author: User

One of the JavaScript books I've been chewing on today is starting out with a little primer, but I have a problem: The simplest alert doesn't pop the data .

<!--my JavaScript learning path-->
<! DOCTYPE html>

Although I have used it to imitate the site, but the most basic way it is not a smattering of operation. The reason it doesn't pop up is that I haven't added an event to it, a bit like in Android, not adding a click event to the button and attempting to hit it.

The changed program is: notice it:

<body onload= "Sayhi ()" >

<!--my JavaScript learning path-->
<! DOCTYPE html>

Through today's reading study, I learned the following knowledge:
1, JavaScript development process: ECMAScript at that time did not have 1.1 version as standard, 1.2 version, ECMAScript version 1.1 as standard, and 1.2 version is not compatible with 1.1 version, 1.3 version compatible ECMAScript, and the use of Unicode encoding; 1.4 Edition This is not built into a Web browser. It has now been developed to version 1.8.2.
2, the mainstream browser (Firefox, IE, Google, Opera, Safari) inconsistent Dom,bom compatibility.
3, <script> Common elements: defer (delay to the full display after the document to perform), async (download immediately), SRC (the introduction of external JS file), type of the specification use (TEXT/JAVASCRIPT).
4, <script> preferably with the external introduction, this can increase the reusability of JS files, for the reuse of JS, do not have to repeat the load. The JS file is uniformly written to the external file, making it easy for the programmer to maintain, and can concentrate on writing JavaScript programs to avoid changing the HTML markup language.
5, <script> storage location, generally placed in </body> before the bottom of the page. This is because loading a non-JavaScript interface first allows the user to feel the access speed faster.
6, in order to avoid compatibility problems and follow the HTML standard, need to use <script></script> method, not:<script/>.
7, <script> cannot be nested two or more layers.
8, understand the <noscript> trigger mechanism, as well as the use of JavaScript in XHTML.
This javascript book as my bedtime reading, will accompany me through a considerable amount of time to learn, thank you for witnessing my growth.
I am a hard transition to do testing, know point PS, know Point Java, know Point html+css.

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.