But sometimes, when an event is triggered, we first do some operations, and then jump, at this point, we need to use JavaScript to achieve this jump function.
The following are the specific practices:
One: Jump to a new page, and when opened in a
where the Getelementsbyname (name) method is to get all the elements in the page that have the name attribute, but this method is not the same as what the IE is fetching in the standard browser. In IE, the Getelementsbyname (name) method takes the
Cloud-dwelling community to streamline the use of version, generally many CMS have some such functions. Dedecms in the selection of related articles is also used in such a function. Here is the specific code.
Parent page Core Code:
Copy Code
"Program Source"
This effect is mainly reflected in the combination of CSS and JavaScript
CSS Code
Copy Code code as follows:
UL, Li {margin:0; padding:0; border:0;}
. shop-rating {
height:25px;
Overflow:hidden;
Zoom:1;
PADDING:2PX
Untitled document
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
Here I quote this code not because it is convenient for me to call later, but to find a point I never use the
function code
Copy Code code as follows:
function parseURL (URL) {
var a = document.createelement (' a ');
A.href = URL;
return {
Source:url,
Protocol:a.protocol.replace (': ', '),
Host:a.hostname,
Port:a.port,
Js. Encode is encoded in the JS code after the formation of "garbled", this garbled in addition to reading, can still be good execution.
Often in the Web page has JS encryption code decoding method, but because there are escape characters in the
1, the number of long, in C # Legal long integer number in JavaScript unexpectedly ...
Look at the following lines of simple code:
Copy Code code as follows:
var a = 2010060612120909191; Id1 generated by Time
var B = 201006061212090
When you use JS to submit data, especially in Chinese, you will often need the string to be submitted for URL encoding. There are several ways to URL-encode strings in JS, Encodeuri,encodeuricomponent, and escape. In many of the code I see, Escape
Just infinte students to put forward "more elegant compatibility" in fact, and this problem has a certain connection (we will see later)
In the helper of function in Youa's script library, add a pattern match that supports overloading
Copy
By the way, please indicate:
Lexical scopes: The scope of a variable is determined when it is defined, not when it is executed, that is, the lexical scope depends on the source code, which can be determined by static analysis, so the lexical scope
First method:, code comparison professional recommendation
Copy Code code as follows:
The second method:
Of course, we can get the value of the parameters in the background, and then in the foreground JS code to get the value
1 JavaScript Object member experiment:
Copy Code code as follows:
var f = function d () {
THIS.A = "a";/* This sentence does not exist after running F.A also does not exist d.a there is a window.a*/
var B = "B";/* local variable/*
Like what:
Copy Code code as follows:
Code 1
function Pig () {}
var pig = new Pig ();
Alert (pig instanceof Pig); => true
function Flypig () {}
Flypig.prototype = new Pig ();
var flypig = new Flypig ();
Alert
For example: When we move the mouse to an icon, the icon will appear some animation effects (gradient amplification, flashing, replacement color, etc.), and all of this friendly effect is basically related to the style, so this one, I learn
CSS and HTML skills Summary, click here: the front-end development of some common skills summary, you can also go to Lange blog, to see by Taobao Ued finishing the front-end tips:http://www.12sui.cn/category/css/.
1. Shorthand for
Let's take a look at the code: (Supports multiple class queries and queries within a range)
Copy Code code as follows:
/*
* Get the element collection based on the element clsssname
* @param fatherid The ID of the parent element,
This article answers the last mentioned questions about pseudo arrays in the JavaScript Universal loop Traversal method foreach.
What is a pseudo array
An object with the length property that can be converted to a true array via
"Nested Functions"JavaScript allows embedded functions that allow functions to be used as data, and under the function lexical scope, can produce amazing places that differ from traditional object-oriented languages.
First, the function of
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