1. As a function call, refers to the global objectIf we define the following functions:function f () {Console.log (this);}It is then invoked as a normal object, that is, f (), at which point this refers to the Global object window.2. A method call
1, onbeforeunload Event:Description: Currently the three major browsers Firefox and IE support the onbeforeunload event, Opera has not yet supported.Usage:Object.onbeforeunload = HandlerDescribe:When the event is triggered, a confirmation and
Labjs is a small JavaScript tool used to load JavaScript files as needed, by using the tool to enhance the performance of the page, to avoid loading JavaScript files that are not needed, and to implement dynamic parallel loading of script files. and
parseURL function
This function creates a new anchor element and uses locationProperties (inherent) to get the desired URL data. Some StringOperations are used (to normalize results across).function parseURL (URL) {var a = document.createelement ('
Below is I find on the internet a relatively simple marquee and JS to solve the picture of seamless scrolling method, including up, down, left and right four directions scrolling, below to introduce you;
Let's take a look at several properties of
Usually our writing cycle is roughly like this:
The code is as follows
Copy Code
function () {The way of writing general circulationfor (var i=0; i...}}
Optimization variable Declaration
The above writing in
Get URL parameters:
The code is as follows
Copy Code
function Geturlparam (name) {var value = Location.search.match (New RegExp ("[?]" + name + "= ([^&]*) ([O.)", "I"));return value? decodeURIComponent (Value[1]): value;}
The code is as follows
Copy Code
JS Code1. Determine if there is a value= "Paravalue" Item in the Select optionfunction Jsselectisexititem (Objselect, Objitemvalue) {var isexit = false;for (var i = 0; I if
Escape solve filter URL transfer value problem, when using Ajax to pass the value, encountered special symbol filtering problem, special symbol test
xml/html Code 01. Special Symbol Test HA: ~!@#$&%^* () <> how are you? Because there is a & symbol
Because the kernel of the Maxthon3 dual-core browser has been modified by their team, it can be judged as follows.
(Note: Only tests were done under mathon3+.)
If you find a problem, or have a better way, please let me know, thank you.
Principle:
Get the page source (document.referrer) when the page is loaded, analyze the search engine keyword, then get all the elements on the page, recursive query contains search keywords, if so, create a SPAN element, and apply the keyword
To print the contents of an array:Code:--------------------------------------------------------------------------------
The code is as follows
Copy Code
function Printelt (element, index, array) {Document.writeln ("[" +
String.prototype.len=function () {return This.replace ([^x00-xff]/g, "AA"). Length;}
(2) Application: JavasCript does not have a trim function like VBScript, we can use this expression to implement
String.prototype.trim = function ()
{
Return
Objective
I believe we all know that because JavaScript is a weak type of language, project writing will be very difficult to control, easy to all kinds of problems. Fortunately there is a strong type of typescript can make up for this defect, but
Tip: you can modify some code before running Similar to Tencent Weibo Come on, let's talk about what you're doing and what you're thinking. You can also enter140Characters
Tip: you can modify some code before running Circular scrolling of images in a controllable direction与之间-->与之间--> Tip: you can modify some code before running
Policy mode refers to the algorithm that defines some columns and encapsulates them one by one to separate the use of algorithms from the implementation of algorithms.Js code that implements the effect of the above example using the strategy mode:1.
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