Get the background color and font color of the Web page as follows:
Thought: By getting the color attribute is worth to the RGB color, not what we want, so you need to change the RGB color to hexadecimal color, first get RGB color:
Copy Code
JS gets a date with the following requirements, according to the date of the week to obtain a week. such as the start date is set for Thursday to the next week of Friday as a week.
The code is as follows:
function Getnowformatdate (thedate)
Self-executing anonymous functions in JavaScriptFormat:
(function () {
//code
Explanation: This is quite elegant code (if you first see a possible confused:), the first pair of parentheses of the enclosing function (function () {})
We know that JS is object-oriented. When it comes to object-oriented, it is inevitable to involve the concept of class. Generally, like C#,java, these strongly typed languages have a fixed syntax for defining classes. JS differs in that it can use
This example describes the application of Sogou map API, which is a very practical technique. Share to everyone for your reference. The implementation methods are as follows:
Initialization of a map
1, add the reference map of the API file:
1, Jquery.countdown Plug-insDisplay format: 50 weeks 01 days 07 hours 18 minutes 41 seconds (seconds to run seconds)A page can have multiple countdown instances, can stop and start, it does not provide too many features, but the time format and
GetAttribute () method
So far, we've introduced two ways to retrieve a particular element node: one is using the getElementById () method, and the other is using the getElementsByTagName () method. Once we find that element, we can use the
JS Code:
function S20 () {
var data=["0", "1", "" 2 "," 3 "," 4 "," 5 "," 6 "," 7 "," 8 "," 9 "," a "," B "," C "," D "," E "," F "];
for (Var j=0;j");
} }
Full HTML code:
;
What is Object oriented? Object oriented is an idea! (nonsense).
Object-oriented can treat key modules in a program as objects, and modules have attributes and methods. In this way, if we encapsulate some attributes and methods, it will be very
document.getElementById ("Louyuming"). Options[0].selected=true;
function Jsselectisexititem (Objselect, objitemvalue) {
var isexit = false;
for (var i = 0; i
The Javascript action Select is a common form of today, when you delete multiple
The JSON data returned by the upload file in the most recent project is prompted to download, and this problem only occurs in ie10+. The front end uses the jquery plug-in ajaxform to submit the form, and the data returned in the background is
jquery $ (document). Ready () is similar to the Window.onload method in traditional JavaScript, but it differs from the Window.onload method.
1. Execution timeWindow.onload must wait until all elements of the page including the picture have been
Although the URL can be dynamically modified by submitting the post form in a get way, but if more than one button can be submitted in parallel, write a number of roughly the same, and some details of the difference between the form, it is
If you want to execute a function asynchronously, the first way we think of it is settimeoutFor example: settimeout (function (/* 1s after doing something * * *) {},1000}
So what if you're going to execute a function asynchronously, most
Now more and more browsers, such as IE, Firefox, Chrome, Safari and so on, so now to achieve a JS copy content to the Clipboard small function is not so easy.
in the Flash 9 era, there is a program that kills all of the browser's JS copy content to
This article describes the JS object-oriented static method and static properties. Share to everyone for your reference. The specific analysis is as follows:
First look at the following code:
Copy Code code as follows:
Think:
This article briefly describes the basic syntax of Jsrender for object. Share to everyone for your reference. Specifically as follows:JsRender as a JavaScript template engine, it is necessary to have a circular function, that is, for, but because
This article describes the JS input user name automatically displays the mailbox suffix list method. Share to everyone for your reference. Specifically as follows:
The following is the code, saved to an HTML file open:
Copy Code code as
As a "photography enthusiast" (OK, I admit I'm not qualified, I only play photography for a few days-_-!! There's always one thing that can't be avoided, is to let the photos with EXIF parameters, although my blog has been installed Plug-ins can
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