Javascript can not only implement inheritance, but sometimes we only need some attributes or methods in the class, so we can consider aggregation to implement
For example, here is just a train of thought. The example is not very detailed. for a
Before using this code, download the jquery library.
Var maskStackCount = 0;
Function mask (method ){
// Here is the window you want to mask. Here I want to mask an iframe window. You can also use var winObj = $ (window)
Var winObj = window. top.
C/C ++ simulates the JavaScript prototype Mechanism
To gain a deeper understanding of the JavaScript prototype mechanism, we can use pseudo-code to implement it or simulate this mechanism. Maybe my understanding is incorrect. If so, I still hope to
Function getOs () {var Sys ={}; var ua = navigator. userAgent. toLowerCase (); var s; (s = ua. match (/msie ([\ d.] + )/))? Sys. ie = s [1]: (s = ua. match (/firefox \/([\ d.] + )/))? Sys. firefox = s [1]: (s = ua. match (/chrome \/([\ d.] + )/))?
2. effect and continuity
In most articles, we use "Read more" to speed up reading.
We need to use the display and hide functions.
For example:
Abraham Lincoln's Gettysburg AddressText Size
Default
Bigger
Smaller
Fourscore and seven years ago our
I recently studied weblogic's jms service configuration and application related things and summarized some articles and so on. Weblogic has a powerful functional advantage in related configuration on the console, which can be recorded as a py script,
Copy codeThe Code is as follows:Technical Essentials:The onkeydown event is triggered before the onkeyup event. When the onkeydown event returns false, the onkeyup event will not be triggered, and there will be no such character in the input box,
One $. fn. live repeat binding
Solution:Use the die () method to unbind all events bound to the element before binding the live () method, and then bind new events using the live () method.Copy codeThe Code is as follows:// Unbind from the die ()
Taking a TextBox as an example, javascript is used to determine whether it gets the focus.
In fact, it is very simple. The normal idea is divided into two ways:
When the text box is a server control, we can easily think of using: if
When I wrote the code one night, I suddenly got a bug and thought for a long time I didn't know where the problem was. (It was actually a very simple problem, but I didn't know it because I was a cainiao ). After several twists and turns, the
Js needs to be added:Copy codeThe Code is as follows:$ ("# Div_bksq"). bgiframe (); Jsp needs to be added:Copy codeThe Code is as follows: Jsp code:Copy codeThe Code is as follows:
Use ajax to verify whether an operation is performed on the frontendThe jquery. post parameter isUrl, [data], [callback], [type]Url: The sending request address.Data: Key/value parameter to be sent.Callback: callback function when sending
I. Basic knowledge about JSON.
Objects in JSON are identified by "{}". A "{}" represents an object, for example, {"AreaId": "123 "}, the object value is in the form of a key-value Pair (key: value ).
"[]", Identifies an array. Each data in the array
Jquery. post usage http://www.jb51.net/article/45181.htmWhen ajax is used to obtain data, data. foo can be obtained directly. The earlier versions of jquery won't work, for example, before 1.4.Copy codeThe Code is as follows:$. Post
Copy codeThe Code is as follows:The defer function in is to execute the script after the file is loaded, so that the object cannot be found. test test In addition, defer is equivalent to executing after the page is completely in, which is
What is a mode?
Broadly speaking, pattern refers to a pattern and process of regular changes and self-repetition on objects or events. In the pattern, some fixed elements are repeatedly reproduced in a predictable manner. The most basic and common
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