In javascript, if we want to obtain the object content, js provides three methods for us: outerhtml, innerhtml, and innertext. But what is the difference between them and their specific usage, maybe many people do not know.
Sample Code:
This article will introduce the document. createElement usage in js and compatibility with some different browsers.
W3C DOM Level2 Core stipulates that the createElement method under the Document interface can create an Element Node object instance.
This article will summarize the code for passing values between frameworks (iframe) in js, from our most commonly used method to my summary of writing a function and some of the following methods for transferring iframe cross-origin values.
Many
In js, the window or page cannot be judged. close () function, but if you want to be compatible with all browsers to close the current window, you do not directly use window. close.
Windows built-in Methods
Window. close ()
The Code is as
This article introduces two good implementation programs for returning to the top by using jq and javascript. For more information, see.
The jquery blog is now out of work on time. Recently, I am very tired. It is estimated that I have worked
Today, I encountered a problem of calculating the array summation. I always felt that the for loop summation was troublesome. I searched for the problem and thought that this method was good, but the eval here didn't know whether it was good or not.
To implement countdown in js, we need to use the setTimeout function. setTimeout can be used to set the execution time or place the display time in the input, div, or other containers.
1. Simple timing pop-up window:
In this instance, we will create
This article describes whether to check the IE instance code. It can be judged by js or jquery. Next I will introduce it separately.
Js determines whether it is IE
The Code is as follows:
Copy code
Function isMSIE (){Var
We want users to perform data verification when submitting data during website registration or submission. In this way, when users input incorrect data, we can directly verify the user data without the need for server processing, this not only saves
This article will introduce some examples of javascript blocking bubble and browser default behavior. I hope some methods will be helpful to you.
When using javascript programming, you may encounter a problem, that is, when you add an event to html,
1. What is an anonymous function?There are three methods to define a function in Javascript:1. function keyword statement:Function fnMethodName (x) {alert (x );}
2. Function Literals ):Var fnMethodName = function (x) {alert (x );}
3. Function ()
In javascript development, we often get the event objects on the page and process these events. For example, the getEvent function below gets the page event objects under javascript.
Copy to ClipboardReference: [www.bkjia.com] function getEvent
I spoke about anonymous functions when I organized the javascript introductory training PPT today.
Writing anonymous FunctionsAs the name suggests, it is a function without a name (⊙ ﹏ ⊙ B Khan ). Anonymous functions are usually used to control
"Changing things and General Principles" must also be implemented in coding. Sometimes the idea is too restrictive. Write your own js framework today (for now, it is called YQ, and will be used in other articles) for examples of browser judgment
The private attribute is available in java, and the powerful function js cannot be implemented as a dwarf, anonymous function, and wide variety of functions.If an anonymous function has no actual name or pointer, how can this problem be solved?In
Html code:Copy to ClipboardReference: [www.bkjia.com] JavaScript and Cookie (1) CookieMessage: Valid-time: Please input a integer.
Js Code:
Copy to ClipboardReference: [www.bkjia.com]
Source: http://www.cnblogs.com/zghlx/
The pop-up window and drag-and-drop effect (that is, popup. js) of the Baidu space are quite good, as shown in. Currently, many well-known websites use this technology.
Recently, during the project development process, the pop-up layer of pages
These two days, I am working on the follow function module (similar to Instagram ). For multiple pages, you must follow or cancel a friend by clicking the "follow" button. Put a button corresponding to a page for operation. Low Efficiency and poor
How does JQuery ajax set synchronous calls (only one function can be triggered at the same time) to solve conflicts with layer display information? The Code is as follows:
Set the following attributes before callingThe prompt layer information is
Step 1: dataType :( $. browser. msie )? "Text": "xml" first, let IE identify whether text or xml is returned.Step 2: function parseXml (xml) {// xml ie encoding problem Step 2If (jQuery. browser. msie) {// determines if the browser is IEVar xmlDoc =
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