In static pages, you can use js to obtain some attribute methods of page parameters. You can search previous articles on this site for specific parameters.
The Code is as follows:
ScriptFunction getParam (){UrlInfo = window. location. href; //
The following code is mainly used on some image websites. You only need to click the link to display the Save image dialog box. Both formats are supported.
First:
Script function SaveAs5 (imgURL) {var oPop = window. open (imgURL, "", "width = 1,
The main advantage of using the closure function for explicit and hidden content is to increase the display and hiding efficiency.
New Document + Click to display love and worry-free, my idol is fruit + Click to display carefree,
Some eval usage methods and techniques for instance analysis. To put it simply, you can convert a string into an expression and return the execution result.
Eval Method
See
String object
Applied to: Global Objects
Requirements
Version 1
Check and
The factory mode primary developers may define the object factory mode as follows:
Basic developers may define objects as follows:
Var obj = new Object ();
Obj. name = "hero ";
Obj. showName = function () {alert (this. name );}
There is a problem
Array declaration methods and other definitions 1. array declaration Methods
(1): arrayObj = new Array (); // create an Array.
The Code is as follows:
Var arr1 = new Array ();
(2): arrayObj = new Array ([size]) Create an Array and specify the
This function is used to calculate the week number of the current month.
The Code is as follows:
Var getMonthWeek = function (a, B, c ){/*A = d = current dateB = 6-w = there are still several days to finish the current week (not today)Divide
Js checks whether two variables are equal to some operators.
=== OPERATOR:
If the two values have different types, false is returned.
Returns true if both values are of the number type and the values are the same.
Returns true if both values are
Dynamically add js events, mainly because events at specific locations are not required. This method is convenient and scalable. // Form object
Function GetObject (Name)
{
Var inputlist = document. all. tags ('input ');
Var I = 0;
For (I = 0; I
{
In JavaScript, in order to achieve separation of performance and control, we can achieve this through level 0 DOM Event attributes or Level 2 event model, however, when calling the corresponding event handle for an event type, the two cannot provide
Method 1: Use the link as a string, break down the link according to the url format, and then obtain the corresponding parameter value.
Method 2: use regular expressions for direct matching.
Keyword: parameter: location. href, url, Link,
Today, I want to implement a new window, such as Baidu souzang and QQ bookmarks, by directly selecting text on the webpage and clicking the link to my favorites (javascript "), the text box in the new window displays the selected text. There are the
Due to security considerations, Javascript is restricted by cross-origin access capabilities. But sometimes we want to do some reasonable cross-origin access things, what should we do? There are two types of situations:
1. Access between subdomains
When the insertCell method is used to add columns when adding cells to a table in Google browser, the results are displayed in the opposite order of program execution and the appendChild method is used to add columns, the display result is in the
Page Loading entries are generally used by everyone. Its principle is very simple: place a text or image loading state in the page header, and load a piece of JS at the end of the page to hide it, that is, the simple Loading state bar implemented
I used a few days to quietly read the JavaScript authoritative guide. A good book! This sentence is too many. What's better? Listen to me. It has been a year since I started to get in touch with JS, and my mind has always been a bit boring. This is
Anyone who wants to learn how to create the jquery plug-in needs to use it. Simplified Plugin:
SimplePlugin.htm:
The Code is as follows:
Simplified plug-in
Returns the original value of the specified object. Object. valueOf ()
The object parameter is an inherent JScript object.
Description
The valueOf method definition of each inherent object in JScript is different.
Object
Return Value
A loading flag is displayed before the image is loaded. After the image is downloaded, the image can be scaled automatically.
The Code is as follows:
/*******************/// Author: no sword (2008-06-23)// Http://regedit.cnblogs.com/// Description:
The old script error is prompted: "options is null or not an object", but the object can be obtained using document. form1.xx or document. getElementById. The old script error is prompted: "options is null or not an object", but the object can be
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.