2nd Chapter using JavaScript

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 makes simple cryptographic processing of parameters in URLs

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

JavaScript is implemented to read the specified parameter value method in the current URL.

GetQueryString:function(name) { varnew RegExp ("(^|&)" + name + "= ([^ &]*) (&|$) "); var r = window.location.search.substr (1). Match (reg); if (r!=null) return return NULL ; }For example:www.baidu.com?id=1

The fast sorting method of JavaScript

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

From Mixin to new and prototype:javascript the prototype mechanism is detailed

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:

JavaScript Summary (eight)

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

How JavaScript lists the non-native properties of global objects.

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.

Common JavaScript trigger events

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

JavaScript easy to confuse knowledge point small review--array method and string method;

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

JavaScript performance optimizations-repaint and Reflow

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),

"Front-end learning notes" JavaScript Common methods compatibility encapsulation

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

JavaScript gets and creates elements

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 =

Use of the My97date Date tool class for JavaScript

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;

"Front-end learning Notes" JavaScript JSON object-related operations

Json method//json.parse (); var json = ' {' name ': ' ZJ ', ' age ': 23} '; Json.parse (JSON); --{name: "ZJ", age:23}//IE6/7 incompatible if (!window. JSON) {window. JSON = {parse:function (JSON) {return eval (' (' + JSON + ') ');}}} Json.stringify (

The ambiguity of the parentheses "[]" in JavaScript

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,

A JavaScript array operation problem

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

How JavaScript lists the non-native properties of global objects.

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 data Type (cont.)

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:

Introduction to JavaScript

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

JavaScript Normal Small example ⑧ (navigation top effect)

JavaScript Normal Small example ⑧ (navigation top effect)

Total Pages: 5378 1 .... 3483 3484 3485 3486 3487 .... 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.