It can be controlled only by ideologically emphasizing JavaScript.

This article, which I accidentally saw today, shares the same feelings and has always felt that JavaScript is more or less biased. This article tells my mind. Figure 1. Poor JavaScript (from Practical JavaScript DOM Scripting and Ajax Projects)

Convert JavaScript amount to uppercase

Effect demonstration Lowercase amount: Capital Amount: Program code Function convertCurrency (currencyDigits) {// Constants: var MAXIMUM_NUMBER = 99999999999.99; // Predefine the radix characters and currency symbols for output: var CN_ZERO =

How to Implement JavaScript class

Javascript itself does not support object-oriented features. It does not have an access control operator and does not define the class keyword. It does not support inherited extend or colons, nor does it support virtual functions, however,

How does Discuz filter special JSON characters?

When using JSON, some special characters make us unable to wait for the expected results. The following filtering method uses the filtering method in Discuz to help us solve this problem. First, the js code that handles this problem is attached with

JavaScript objects, arrays, and hash tables

In javascript, an object is actually a hash table, such as the following user object: function user(n, a){ this.name = n; this.age = a; this.toString = function() { return "Name:" + this.name + ", Age:" + this.age; }}var u = new

The subtle relationship between functions and objects in JavaScript

Before the rise of ajax, many people write JavaScript, which can be said to have no rules at all. Basically, they write anything when they think of it. It is a function one by one, and copy is required for repeated operations, if you accidentally

JavaScript intercepts Chinese and English strings

Sometimes it may be too long to display a text segment, affecting the Display Effect of our page. If it is only English, we can use the String. substring (start, end) function. However, we usually encounter both English and Chinese characters. The

Float Your webpage title

If you use WebQQ, you may find that every time you receive the information, you will see the user or group prompted by the title. Then, the title of the webpage will start to float and be user-friendly, very interesting. This effect is actually not

Functions for converting arrays, objects, and strings to JSON

In many cases, the json text transmitted from the server is complicated. The following functions can convert arrays, strings, and objects into JSON-format content. JSON = { encode : function(input) { if (!input) return 'null' switch

JavaScript implementation of some common algorithms

In Web development, JavaScript and algorithms are also important. The following describes the implementation of some common algorithms in JavaScript, this includes binary classification, String Length determination, array deduplication, insertion

Interesting things at the beginning of JavaScript

I am often exhausted by its strange syntax when reading many excellent JavaScript source code, so it is necessary to reinforce the basic knowledge of JavaScript from time to time, every time you think about this kind of knowledge or think about it

Implementation of the JavaScript color selector

The following JavaScript color filter allows you to easily design the color for Web pages. You can also see how the common color filter is implemented on the Internet. Only the core JavaScript code is provided here. For other parts such as CSS,

Working principle behind JavaScript prototype

Prototype literal translation is a prototype and the main means for javascript to implement inheritance. Roughly speaking, prototype is a reserved property of functions in javascript, and its value is an object (we can call this object "prototype

JavaScript array traversal prototype extension of map ()

In JavaScript 1.6, several useful methods are added to the javascript array: indexOf, lastIndexOf, every, filter, forEach, map, and some. The first two methods can be classified as element locating methods, the subsequent several can be classified

JavaScript variable scope

Before learning the scope of JavaScript variables, we should clarify the following points: The scope of JavaScript variables is based on its unique scope chain. JavaScript has no block-level scope. The variables declared in the function are

How does JavaScript calculate the time difference between two days?

Sometimes we need to know how many days, hours, or even minutes between two dates. Here we use JavaScript to implement a function to calculate the time difference between two dates. Let's take a look at the Code: The method is simple, for example,

How to obtain the value of iframe DOM

In Web development, there is often a problem. I have embedded iframe on a page and want to get the value of an element on this iframe page. How can we achieve this? Let's take a look at the demo:Effect demonstration Value of the text box in iframe1:

How to accelerate JavaScript loading and execution

Javascript has a silent blocking feature, that is, when a Browser executes Javascript code, it cannot do anything else at the same time, whether its code is embedded or external. When the browser encounters a In order to improve the above

Imitation of Inheritance Mechanism in JavaScript

First, we will use a classic example to briefly describe the Inheritance Mechanism in ECMAScript. There are only two types of geometric shapes, namely, the elliptical shape (circular shape) and the Polygon Shape (having a certain number of edges ).

Implementation of JavaScript gradient effect

Let's take a look at the demo: Simplified Ming Now Generation Magic Method The transparency of the above elements increases gradually when the mouse moves up, while the transparency decreases gradually when the mouse moves out. Key

Total Pages: 5378 1 .... 4000 4001 4002 4003 4004 .... 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.