When we submit data through textarea on the page, the content we input will be processed as a piece of content after submission, even if we input a lot of line breaks in textarea, after a piece of content is submitted, what should we do if we need
Many websites now display a line of announcement on the top of the website. From the normal html source code, the announcement content must be at the beginning of all the elements on the page, that is, the first element after the body element. The
I often see my friends in the QQ Group asking me where there is a good pop-up advertisement effect in the lower right corner. The author will share with you a pop-up advertisement special effect that I often use in the lower right corner, which is
Js determines whether an element exists in a js array, which is equivalent to the in_array function in php.
Array. prototype. S = String. fromCharCode (2); Array. prototype. in_array = function (e) {var r = new RegExp (this. S + e + this. s);
In the web development process, images uploaded by customers in the content area are often broken. The width is the main factor, if the image taken by the camera is directly transmitted to the website without any processing, and the image width is
When debugging js in web development, you often need to print arrays and objects. As js itself does not directly print arrays and objects as php does, the author has summarized two methods to solve this problem, next let's take a look at how to
In js, the hash method is used to determine whether there are repeated values in an array. It is easy to use and is the same as normal functions.
Function checkArrayRepeat (array) {var hash = {}; for (var I in array) {if (hash [array [I]) {return
JQuery implements several effects that gradually fade out the image. The same principle! Absolutely easy to use!
The effect of pure image switching is as follows:
The following figure shows the effect of digital loop switching with serial
Some websites that display html special effects often add an effect such as running code on a specific page, that is, the special effect code is in the textarea text box. Below is a running code button, click the run button, the code in textarea is
This article mainly shares the usage of the setInterval and setTimeout functions in javascript.
SetInterval () Definition and usage
The setInterval () method can execute functions or expressions according to the specified period (in milliseconds.
Recently, due to project requirements, you need to enter QQ expressions in the text box where you leave a message. This effect is already very common, next, I will share a QQ emoticons plug-in that I found on the Internet using jquery.
First, let's
The following example shows how jquery binds events to dynamically created nodes:
$ ("# Table "). append (" Delete "); $ (". del "). click (function () {alert ("get to pull ");})
The above Code does not work. If you want the above Code to achieve
How does Jquery bind events to elements? Remember to avoid forgetting it!
$ (This ). bind ({click: function () {window. open (alert ('OK');}, mouseover: function () {window. open (alert ('OK');}, mouseout: function () {window. open (alert ('OK '));}
Today, when I wrote a js latency event, I found that the $ (this) of jquery In the setTimeout method did not work. Various tests, the final conclusion is that the setTimeout does not support jquery selector. So I consulted a professional on jquery
The following example shows how jquery processes json data in combination with php:
Php code:
$ Data ['id'] = 1; $ dat ['name'] = "mary"; $ da ['red'] = array_merge ($ data, $ dat ); $ data1 ['id'] = 2; $ dat1 ['name'] = "Swallow"; $ da ['blue'] =
Dynamic HTML element creation is not actually useful. You also need to insert the newly created element into the document. The easiest way to insert a newly created node into a document is to make it a subnode of a node in this document. The append (
Jquery siblings is used to obtain the compatriot of each element in the matching set.
Syntax
. Siblings (selector)
Note: You can use the optional parameter selector to further filter data.
Example:
Find all peer elements of each
The function of the jquery live method is to add event responses to the dynamically generated content. For details, refer to this article if you are interested:
JQuery adds Event Response to dynamically generated content (jquery live Method
I recently found a problem in my work. After I wrote some jquery code on a good webpage, it never worked. No matter how simple it is, it never worked, it seems that jquery has failed. When Firefox lowered the limit, the page reported TypeError $ (...
This article mainly introduces some basic Jquery performance optimization knowledge.
1. always inherit from the ID Selector The fastest selector in jQuery is the ID selector because it comes directly from the getElementById () method of
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