JavaScript language basics 3: javascript language basics

Source: Internet
Author: User

JavaScript language basics 3: javascript language basics

JavaScript can process data types from the real world, such as numbers and text. At the same time, JavaScript also contains some

Abstract data types, such as object data types.

JavaScript is a weak type language. In many cases, when we process data, we do not need to declare the data type.

Their types have been calculated.

Since JavaScript is a weak type language, do we have to discuss the data type? In fact, in some cases, errors may still occur, or JavaScript

It is inferred that it is different from what you imagined. In these cases, we need to display the declared data type in JavaScript.

Next we will discuss several common JavaScript data types: numeric, string, and Boolean.

I. numeric type

1) integer: such as 1, 2, 3,-1,-2, and so on. The integer can be positive or negative, and the range is-2 ^ 53 ~~ 2 ^ 53.


2) score: for example, 2.3 or-4.3. Same as above, the score can be positive or negative.


In actual use, you don't have to worry about the value range in JavaScript. JavaScript regards them as floating point type.


Ii. Text Data

In JavaScript, a string is a piece of text enclosed by quotation marks, such as "Hello World" and "123 ".


JavaScript contains many special characters that cannot be directly entered. At this time, we need to use escape characters to represent them. We use & nbsp; to represent a space character, the usage of escape characters is as follows:

Meaning of escape character series

\ B Return character

\ F page feed

\ N linefeed

\ R carriage return

\ T TAB)

\ 'Single quotes

\ "Double quotation marks

\ Backslash

\ XNN, where NN is a hexadecimal number that represents the character number in the Latin-1 Character Set


Iii. boolean data

The value of the Boolean Type in JavaScript is: true indicates "yes", and false indicates "no"






Reprinted please indicate the source: http://blog.csdn.net/hai_qing_xu_kong/article/details/40735895 sentiment control _Click Open Link





What is the basic language of javascript? What language is the basic language of aspnet ??

Many people have such misunderstandings about JavaScript as derived from the Java language. In fact, JavaScript is an independent Web Page scripting language. It has nothing to do with Java, but it is just similar in syntax. Javascript is used regardless of asp.net, Jsp, PHP, or asp. The biggest difference between JavaScript and C #, Java, and other programming languages is to execute and compile the code first. That is to say, the JavaScript script will be downloaded to the user's computer as the web page, and then loaded to the browser, the JavaScript script is compiled only when the corresponding event is triggered. This is completely different from that of the Java or C # language on any server.

For your convenience, I will give you an example. For example, if you do not enter a required field on the user registration page, or the entered content is invalid (for example, if the QQ number is written as "abc"), the browser will give you a prompt to correct the error. This is the role of JavaScript, it reduces the load on the server and accelerates user experience. Therefore, JavaScript is an important part of a website.

Ps: JavaScript can also be used for some special effects. There are a lot of code on the Internet. You can check it out.

Asp.net is based on C # and is now a popular language like Java. It is favored by many enterprises because of its great advantages in rapid development. However, Microsoft is not as selfless as Java. To keep its dominant position in Windows, Microsoft. net platform (including ASP.. NET Security is indeed a headache. Of course, if your website does not have high security requirements, ASP. NET is a very good choice.

Speaking of learning, I suggest you study both C # and JavaScript, because these two languages and the Java language in Jsp are similar in syntax structure, as long as you have learned one, others will be easy to understand. However, do not think it will be very simple, because as a developer, it will always be a rookie in front of these languages. Only by tirelessly absorbing new knowledge can you ensure that you are ahead of others.

I have said so much, hoping to help you, and wish you success! Thank you!

What are the differences between html language basics, javascript program basics, and ASP programming basics?

Html is just a tag used to format and display webpage text. The most basic and rigid language is mainly used for static pages. Js is a client scripting language and a programming language used to realize dynamic and Intelligent Web pages. For example, we often use dynamic records of website registration to detect the strength of passwords, it is written in js or vbs. ASP is a script language on the server. It is used to dynamically generate html files, such as the welcome page of the QQ space. Why is the content of the welcome page different from that of every user after login? It is actually generated using ASP or other server scripting languages based on different user dynamics.

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.