Little bit of accumulation --- beginner Javascript, little bit --- javascript

Source: Internet
Author: User

Little bit of accumulation --- beginner Javascript, little bit --- javascript

On the way to learning knowledge, we need to constantly contact new knowledge. At the same time, we should not constantly summarize our old knowledge. Recently, I have a preliminary theoretical understanding of Javascript through "Niuke Javascript" and "special Javascript video" by Jiang Hao.

Introduction to Javascript Learning

Javascript is a client scripting language that is based on objects and events and is relatively secure. Therefore, you need to have a certain object base when learning Javascript. Since you have learned C # and VB. NET, it is relatively easy to understand in the learning process.

At the same time, JavaScript is also a widely used scripting language for client Web development. It is often used to add dynamic functions to HTML (a subset of standard General Markup Language) webpages, such as responding to various user operations. So now we are learning Javascript For Web development.

In general, the complete JavaScript includes the following parts:

  • ECMAScript, which describes the language
  • · Document Object Model (DOM), which describes the methods and interfaces for processing webpage content
  • · Browser Object Model (BOM), which describes the methods and interfaces for interacting with the browser

Its basic features are as follows:

  • Is an interpreted scripting language (code is not pre-compiled ).
  • It is mainly used to add interactive behaviors to HTML pages.
  • HTML pages can be embedded directly, but writing a separate js file facilitates the separation of structure and behavior.

JavaScript is often used to complete the following tasks:

  • Embed dynamic text into HTML pages
  • Respond to browser events
  • Read and Write HTML elements
  • Verify the data before the data is submitted to the server
  • Detect visitor's browser Information
  • Control cookies, including creation and modification

Javascript and VB

When I was learning Javascript, I was always thinking that when I was learning VB, I started to explain the basic syntax and basic objects step by step; the difference may be that VB (without inheritance) is based on object-oriented Javascript (without polymorphism) it is fully object-oriented. The former is a compiled programming language, and the latter is an interpreted scripting language.

The following two figures show the differences between the two:

(Ps: summary chart when learning VB)

 

(PS: A Summary of Javascript. The basic object, BOM, and DOM are all objects in Javascript)

Summary

No matter what we learn, we should contact the previous knowledge. In comparison, learning this requires us to be more impressed and understand the learned knowledge. At the same time, through comparative learning, we can find different points and similarities in different knowledge to build our knowledge network, which will be of greater help to our future studies. In this process, we will form a virtuous circle, which will shorten the cycle for us to learn new knowledge.



Javascript beginners

For... in can be used to traverse the attributes of an array or an object. The object friends has three attributes: "Hank", "bill", and "steve". Their values are all objects,... in can traverse the attributes of friends, but only get the attribute names, that is, "Hank", "bill", "steve ", if you want to access the values of these attributes, you can use the friends ["Hank"] method (the attribute name is used as the index to access the attribute value)

JavaScript beginners

<Html>
<Head>
<Title> function </title>
<SCRIPT merge Ge = "JavaScript">

Function car (seats, engine, radio)
{
This. seats = seats;
This. engine = engine;
This. radio = radio;
}
Var wcar = new car ("cloth", "V-6", "Tape ");
Var fcar = new car ("leather", "v-8", "cd ");
Var etype = wcar. engine;
Alert (etype)
Var stype = fcar. seats;
Alert (stype)
Var rtype = fcar. radio;
Alert (rtype)
</SCRIPT>
</Head>
<Body>
<SCRIPT merge Ge = "JavaScript">
Document. write (etype + "");
Document. write (stype + "");
Document. write (rtype + "");
</SCRIPT>
</Body>
</Html>

Change document. write = to document. write.
Change etypee to etype
Change var stype = fcar. setats;
Var stype = fcar. seats;
OK.

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.