In js, we need to check whether the variable is a number. We can directly use the isNaN function. The isNaN function judges the opposite. If you input a number, it returns false, not the data, you can clear this point.
IsNaN Function
IsNaN
Image pre-loading is a bit like lightbox. It is automatically loaded without the width and height of the image. In this way, the image size is automatically set when you want to view the image, this will make people feel fast. Next I will introduce
We generally use window to refresh the framework in js. parent command, which is used to refresh the parent window in a child window. to refresh the parent window, specify the window. parent [Window name] to operate. Next I will give you an instance.
We will see that many websites will have an effect. If the content does not exceed the div height, it will be displayed directly. If it is relatively long, there will be a scroll bar effect. Next I will introduce this implementation method to
This article introduces the tips for improving the readability of JavaScript code. Here we will introduce the methods. For more information, see.
Flattening Logic
In our work, we may encounter some complicated logic, such as: Meet condition 1, or XX;
In js, the most common code for converting arrays and strings is to use the join and split functions for operations. This is somewhat similar to array and character conversion in php and asp, next I will introduce the operation methods in js.
Method
Here we will introduce the regular assignment of values to the specified div. We can use the setInterval or setTimeOut Function to execute the ajax function, so that we can refresh the function in a few seconds, let's look at the instance.
Example
This article will collect some of the control form operation functions commonly used in front-end WEB development for your reference.
. Automatically select text when the mouse passes
Code:
Mouse Selection:
2. Set the radio button
Code:
js
This article introduces the src Method for matching images and all image addresses in js regular expressions. For more information, see.
Implementation: Use the js regular expression to match all images and all image addresses in src.
Idea: 1. Match
This article will introduce you in detail a jquery code compatible with the ie6 instance on the top of the suspended page after scrolling to the navigation bar. For more information, see.
Jquery Implementation Method
The Code is as follows:
This article introduces how to use prototype attributes in Javascript. This article is applicable to beginners. I hope to help you all.
First, we need to first understand the concept of a class. JavaScript itself is an object-oriented language, and
The simplest way to copy content in js is to directly use createTextRange () and execCommand () and then there are window. clipboardData. setData and so on. Next I will summarize various application instances.
Example 1
The Code is as
Sometimes we do not want the user to submit data repeatedly, so we want the user to submit the form after the button is temporarily unavailable, and the data cannot be submitted again. Next we will introduce two instances.
Instance 1
The
Ajax get usually produces some cached data by default, if we want to disable the creation of cache, we can add a disable cache or add a random parameter after the url to solve the problem of ie cache and ajax cache.
Yesterday we encountered a
Codemirror is a powerful syntax highlighting engine developed by javascript. It supports many languages, such as PHP, JS, HTML, and CSS. Here we will briefly introduce how to use Codemirror to configure your website to support code syntax
JS Summary of common JavaScript methods. The Institute of fire is reposted on a friend's technical blog, with a total of 107 articles, hoping to help you learn about JS.
1.doc ument. write (""); Output statement2. Comments in JS are //3. The
Sets or obtains the specified file name or path of an object.
Alert (window. location. pathname)
Set or retrieve the entire URL as a string.
Alert (window. location. href );
Set or obtain the port number associated with the URL.
Alert (window.
In javascript, the keyword "this" is a difficult concept to grasp. It refers to different objects in different situations. Let's take a look at the differences between the usage of this in JavaScript?
1. Use the this keyword in the inline mode of
This is a JS function to get the element location coordinates, share with you, more JavaScript, please visit the house of help Chinese manual: http://www.bkjia.com/a/manual/jscript/
Copy to ClipboardReference: [www.bkjia.com] function elementLeft
The variable {page} can be used to represent the current page;
Is the container output by page;
For the content output format, which is determined by the data returned from the backend;
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