A. Create an HTML pageAlthough many textbooks are now beginning to use HTML5 to explain JavaScript lessons. But I think this may be more advanced, for JavaScript beginners, we still use the more popular and stable xhtml1.x to create a page.Many
JavaScript APIs are inherently Base64, so we can easily encode and decode them.var encodedata = Window.btoa ("name=xiaoming&age=10")//codevar decodedata = Window.atob (encodedata)//decoding.Here is a concrete example of how to transcode the
In the sort order, fast is more commonly used because of its fast speed.Because it is recursive recursively, it is returned based on the left and right sides of the datum point, until the array has only one value.This datum point is
This is an article in the markdown format, a better reading experience please visit my github, mobile end please visit my blogInheritance is to achieve the reuse of methods, how to achieve the reuse of the method? The easiest thing to think about is:
Form validationForm validation is one of the most common and useful features of JavaScript. Validation before the form content is submitted can reduce the pressure on the server processor and shorten the time the user waits. The first question to
WhyWhen researching a website's front-end technology, it is a good idea to understand its global object.In general, the common library will use the appearance pattern, finally exposes an object to the user to call,Like Jquery,requirejs,angular,react.
Event handle
Onclick=javascript; mouse click an object. 3
Ondblclick=javascript Mouse Double-click an object. 3
Onmousedown=javascript; a mouse button is pressed. 4
Onmouseup=javascript; a mouse button is released. 4
Array properties:arr.length; View the length of the array arr. Delete the last element of an array;Array of methods:Arr.push (); Add to the end of the array; Arr.shift (); Delete the first element of the array; Arr.unshift (); Adds an element to
Repaint (redraw), when repaint changes, the appearance of the element is changed and occurs without changing the layout, such as changing the outline,visibility,background color without affecting the DOM structure rendering.Reflow (rendering),
Get Style function encapsulationfunction GetStyle (ele,attr) {if (Ele.currentstyle) {return ele.currentstyle[attr];} Else{return window.getComputedStyle (Ele,null) [attr];};GetClass () packagefunction getclass (element, names) {//If there is a
1. Get elements in JavaScriptCommon ways to get elements in document:1) document.getElementById () = "gets the specific element in the document by the element ID, such as the button that gets the id =" Button1 "can be written as: var btn =
A developer's favorite thing is to have tools and use them directly (. ~.)Use:1. Set Input tag2, according to its demo file, the introduction, the event processing3. Effect4. EffectCode:my97date #na {width:300px;height:30px; color:blue;
Absrtact: This article is mainly about sharing four kinds of semantics of the parentheses in JavaScript. There are four types of semantics for JavaScript in parenthesesSemantics 1, declaring an arrayvar ary = []; Declares an empty array var ary = [1,
The topics are as follows:var arr = [' 100px ', ' abc ' -6,[],-98765,34,-2,0, ' + ',,functionnulltrue function() {alert (3);}, ' xyz ' -90 ]; // 1. Find all the numbers in arr: -98765,,-2, 0, 5 // 2, find can be converted into numbers: "100px",-9876
When researching a website's front-end technology, it is a good idea to know its global object, generally speaking, the common library will use the appearance pattern, finally exposes an object to the user to call, for example
JavaScript objectsObjects are separated by curly braces. Inside the parentheses, the properties of the object are defined in the form of name and value pairs (name:value). Attributes are separated by commas:var person={firstname: "John", LastName:
JavaScript historyTo understand JavaScript, let's first review the birth of JavaScript.In the 1995 of the last century, Netscape was the most famous first generation Internet company in the Web era with its navigator browser.Because Netscape wanted
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