JavaScript Object-oriented learning (I.)

An orientation-oriented first experienceCreate a label// 传统var=document.createElement(‘p‘);var=document.createTextNode(‘我是传统js创建的文字‘);p.appendChild(txt);document.body.appendChild(p);// 面向对象

Self-study JavaScript week fourth

This week is less time, not learning something new, reviewing some of the regular expressions you learned before, and writing a block of code that can be replaced by strings.var s= "Zhang 356 points, Li 474 points, Wang 592 points, Zhao 684

The grouping and forward-looking matching of JavaScript regular expressions

This article mainly explains the group match and the forward match in the regular expression of JavaScript, need to have the basic understanding to the regular, I have been to two kinds of match ambiguity unclear. So summarize here, if there is not,

Some pits of this in JavaScript

We often encounter some pits in the callback function:var obj = { name: ‘qiutc‘, foo: function() { console.log(this); }, foo2: function() { console.log(this); setTimeout(this.foo, 1000); } }obj.foo2();Executing this code we will find

This in JavaScript points to the problem

This is a keyword in the JavaScript language.It represents an internal object that is automatically generated when the function is run, and can only be used inside the function. Like what function Test () { this.x = 1; } The

The first JavaScript code

Since our CSS has to be placed in a special style tag, JavaScript also needs to be placed in the child's tag, which is the script tagIn the page, we can put tag pairs in the body tag , tag pairsWe can define it directly in the body or in heard,

JavaScript simple effects and summaries

Element object in 1.js* * var Input1=docuemnt.getelementbyid ("Input1");alert (Input1.value);Alert (input1.getattribute ("attribute name"));Alert (input1.setattribute ("attribute name", "attribute value"));Input1.removeattribute ("attribute name");

This of JavaScript

In a nutshell: This in the JavaScript function always points to the direct object that called the function. Of course through apply (), call (), bind () These methods can change this exceptInstance 1:alert (this = = = window); True the direct object

JavaScript Quick Sort

Use the quick sort in the book "JavaScript Data Structures and algorithms" and add your own understanding.This algorithm has been tested faster than the built-in sort! And the Nanyi of the fast platoon is more like a merge sort, although the writing

Javascript-Common Code specification

Spec. 1: Be sure to write down global variables, and try to implement various functions, repeating code, etc. into a function.Advantages: It helps to read and maintain. Prevent variable contamination.Spec 2: All functions, variables, semantics. Spec.

JavaScript QuickStart-ecmascript Local objects (REXEXP)

I. Overview The RegExp object represents a regular expression, which is a powerful tool for performing pattern matching on strings. A regular expression is a search pattern formed by a sequence of characters. When you search for

JavaScript Analog ATM Service

Const ReadLine = require ("Readline-sync"); let time= 0;//number of passwords lostLet x = 1;//Temp VariableConsole.log ("Please enter your password"); let password= Readline.question ()-0; while(Password! = 123456) {Console.log ("The password you

Get the scroll position of the current page in JavaScript

To get the vertical position of the scroll bar for the current page, use:Document.documentElement.scrollTop;Instead of:Document.body.scrollTop;The documentelement corresponds to an HTML tag, and the body corresponds to the body tag.DocumentElement

JavaScript common string methods and properties

I've been listening to you on Himalaya. (JavaScript Web front-end) host ShahiIt's a good one. Buy this book now make a notevar str = ' ABCD 'Str.charat (0); Output the character of the subscript positionStr.charcodeat (0);//The character encoding

JavaScript string Inversion

abs

The first approach: using Built-in methodsThe split () method splits each character of a string object and treats each string as each element of the arrayThe reverse () method is used to change the array, order the elements in the array sequentially,

JavaScript Operation Cookies Detailed

JavaScript Operation Cookies DetailedThis method of operating cookies I used for a long time, but has not encountered any problems, today in the first page to save the cookie, the second page Gets or the third page to get the function, found the

JavaScript function Throttling

In fact, the earliest look at the design pattern is the simple understanding of the JS language itself, so it is easy to forget after reading the understanding, perhaps after the actual work needs to remember it;Look below: "en"> "UTF-8">

The name and version of JavaScript

language Standard Version name: ECMAScript (ECMA is the European Association of Computer manufacturers, it is said that it may be a standard, in addition to JavaScript to follow this standard, there are xx .... )Jscript (ie's description of the

Several ways to de-weigh javascript arrays

Several ways to de-weigh javascript arrays Creates a new empty array, iterates through For...of (ES6), and, by IndexOf, determines whether the element exists in the new array, and then push the nonexistent (INDEXOF (n) ==-1) element to the new

[JS Master's Road first part] JavaScript on hundreds of actual combat "new" _20 read style with classname and shielded empty anchors

1 DOCTYPE HTML>2 HTMLLang= "en">3 Head>4 MetaCharSet= "UTF-8">5 title>Documenttitle>6 style>7 Div{8 width:200px;9 Height:200px;Ten background:Red; One } A . Active{ - width:400px; - Height:400px; the background:Blue; - } -

Total Pages: 5378 1 .... 2014 2015 2016 2017 2018 .... 5378 Go to: GO

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.