Projects sometimes use some Ajax effects. Because it is relatively simple, there is no such thing as Ajax.net, And the handwritten code is implemented. The next day, someone reported an error to me, saying that only the value read for the first time
If we use the original javascript cross-origin to call JSON data, we use createElement and dynamic to add a remote data interface to src. Now we can also use jquery ajax getjson for an instance.
Original js writing
The Code is as follows:
Webpage transition has some effect on page loading. Many personal websites use this function. If I only pursue the effect of IE browser, I can directly use revealTrans to implement webpage transition special effects. If the compatibility is strong,
In many pages, you will see this type of div effect that follows the scroll bar, which is a fixed position. The following section encapsulates js following the scroll bar Plug-In due to project requirements. If you need it, you can refer to it.
Js
As long as we use js settimeout and div to combine the countdown, we can achieve the display time per second. Below we have sorted out an example used in our work and shared it with you.
The countdown function is used in many previous activity pages.
Add a version or connection address after the content of the website copy. This is what most webmasters do now, now I have sorted out some frequently-used JavaScript codes for automatically adding copyright information to the copied content. Some
There are many rounding functions in js, such as toFixed and Math. round () and Math. pow () and other functions. The following articles mainly introduce toFixed and Math. round () and Math. do not miss out on the four functions of pow.
Previously,
This article will introduce how to compare objects in JavaScript.
In JavaScript, it is a little troublesome to compare the members of two objects. If it is only the first layer, it is easy, but the attributes in the sub-object may be an object, so
This article describes how to use the key type in javascript for in. for more information, see.
Many while, for (var k = 0; k
The Code is as follows:
Copy code
Function getAvgSum (arr, param, flag ){Var as = 0;If (param
There are a lot of functions that provide data in js, but I have not been able to implement the method I want for a long time, later, I found that you can use the indexOf function to find and locate the index values of array elements. For more
To make the code clear and structured, you usually need to separate the page configuration parameters and code logic. Define a unique namespace to implement basic so-called structure and behavior separation.
The first method is to provide a global
In IE, A fireEvent method is provided, which, as its name implies, triggers an event. At the beginning, I thought it would be the same as using onclick () in normal times. I did not expect to find it when I was writing a javascript getting started
UglifyJS is a tool for compressing and beautifying javascript. In its documentation, I see several methods for optimizing if statements. Although I haven't used it for some trial tests, I can see from here that it has done some beautification work
I. What does this Article do:
You can use javascript to obtain user operations and modify url parameters to implement certain functions, such as query (a specific query is implemented by a query statement consisting of parameters in the url obtained
Javascript does not implement a hash table (hashtable) like c # and java. In js, the implementation of object attributes is the hash table. Therefore, as long as the point method is encapsulated on the object, the simple and efficient hashtable can
EgExp object (the most easy-to-understand and in-depth Regular Expression tutorial I have seen so far) JavaScript provides a RegExp object to complete operations and functions related to regular expressions, each regular expression pattern
1. javascript prototype: prototype requires a constructor to define object members when implementing object-oriented (such as defining a class, methods are attached to the prototype of the constructor.
2. In javascript, prototype of the subclass
The help house (www.bkjia.com) Tutorial uses pure JavaScript to achieve the typing effect. It is very attractive to simply "type" and has a more personalized function, you can drag a bar to adjust the typing speed, automatically scroll the screen,
We know that ajax actually uses XMLHttpRequest objects to perform asynchronous data interaction. For security reasons, the browser does not allow cross-origin operations of js code, so js cross-origin operations will be rejected.
Specific situations
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