The instance is as follows:
Untitled document
Above this JavaScript in the three Boolean types of scenario code is a small series to share all the content, hope to give you a reference, but also hope that we
1. Use function class
Myfunction.js the
public method of the Var cmyfunc=function () {
//class for external calls to this
. Func1=function ()
{
var i=0;
return i;
}
This. Func2=function ()
{
_privatefunc ();
}
Class for public method
Two days before the program because to use JavaScript in the Window.event event, so on the internet search, and finally found a good article to share with you:
Description
An event represents the state of an incident, such as the element that
typeof is used to detect the data type of a given variable (also called the basic type, the base data type.) Contains Undefined, Boolean, string, number, object, functionvar message = ' So easy ';Alert (typeof message); "String"Alert (typeof 12);
JS generally has two different data types of values:
Basic types (including Undefined,null,boolean,string,number), passed by value;
Reference types (including arrays, objects), delivered by address, and reference types are in-memory addresses when
This article mainly introduces the ordinary function, the anonymous function, the closure function
1. General function Introduction1.1 Example
Copy Code code as follows:
function ShowName (name) {
alert (name);
}
Each function object has a length property that represents the number of parameters that the function expects to receive.
Copy Code code as follows:
About the JS object-oriented creation method,
Goal:
The For In loop executes a property in an object
With statement: (Object action Statement)Function: Create default object for a program
Format:
Copy Code code as follows:
With () {
}
Specific examples:
Copy
Now there are a lot of things that are similar to Twitter, and here's a small case of Twitter-like tweets
microblog release &L
T;style type= "Text/css" > *{padding:0;
margin:0;
} ul {List-style:none;
box {width:600px;
A long time no post ~ ~.
Because the work needs, imitation watercress writing a pagination style.
Self-feeling, such a page before and after the balance, for the user experience is quite good.
imitation watercress Paging prototype
Use JS to set cookies, read cookies, delete cookiesJavaScript is a script that runs on the client, so it is generally not possible to set a session because the session is run on the server side.
Cookies are run on the client, so you can use JS to
In the development of often encountered to remove all of the scroll bar, remove the right scroll bar and retain the bottom of the scroll bar, remove the bottom of the scroll bar and keep the right scroll bar, we are based on how to achieve the JS?
I like to start from the most basic content, and then slowly in-depth, the master may have to give some patience ah.
First look at one of the simplest applications. In the following code, we need to implement a function, that is, click each button
Foreword: The frequent surfer friend may have visited such some websites, one enters the homepage immediately to pop up a window, or presses a connection or the button to eject, usually in this window may display some notices, the copyright
Main.htm:
Copy Code code as follows:
iframe Adaptive Load Page height
child.htm:
iframe Adaptive to its loaded Web page (multi-browser compatible)
IFRAME Adaptive to its loaded Web page
When you use an IFRAME on the page, you generally do not want the IFRAME to display unsightly scroll bars so that the contents of the IFRAME and the contents of the main page are seamless. At this point you will set the scrolling= "no" attribute.
Copy Code code as follows:
Authenticode:
Recently have no mood to write blog, mainly because of the upset things gradually more.
Hey! Digress, back to this article. When it comes to using JS to achieve the function of click and
& Lt;meta http-equiv= "Content-type" content= "text/html;
charset=gb2312 "> javascript chained call
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
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