Performance
Minimize DOM access and markup, reduce the use of methods such as document.getElementsByTagName (), and store the values returned by such methods in variables.
Merge scripts, style files, picture files, and so on to reduce the number of requests to load pages.
Compress the script.
JavaScript is separated from HTML tagsWhen we add an action, there is a first reaction: This is JavaScript code function doSomething1 (n
A PHP function that can delete HTML tags in a string
Author: limote
When guest comments and postings, we do not want visitors to use HTML tags in the comments and posts, so I have to delete the HTML tag when the visitor submits the message and the post, the following fun
A PHP function that can delete HTML tags in a string
Author: limote
When guest comments and postings, we do not want visitors to use HTML tags in the comments and posts, so I have to delete the HTML tag when the visitor submits the message and the post, the following fun
Semantic Tags: What labels do you think best describes the content and makes it more meaningful to use this tag?Now the browser is very perfect for CSS support (not including CSS3), is the structure and performance of the separation, structure and behavior of the separation, a Web page, the structure is the most important, the structure is equivalent to a house wall, the label is a block of bricks, the brick is orderly, put the rectification Qi, the w
Most of the time we are clearing HTML tags but always want to keep some of the tagsImplement in ASP language Str= "The regular can also be implemented in other languages.The following are implemented in the PHP language:$str = ' Of course, PHP has a simpler way of implementing it:$str = ' Clear HTML tags but keep some
JS Filter HTML tags and nbsp; regular
Although read the regular expression of the content is seen, but after all, or just contact, even the basic concepts are very vague, so had to find the following online code:
function SetContent (str) {str = str.replace (/Str.value = str.replace (/[|) *n/g, ' n '); Remove line trailing blanksstr = str.replace (/n[s| |) *r/g, ' n '); Remove extra blank linesreturn st
Regular expressions are used for string processing, form validation, and so on, practical and efficient, but often not too sure to use, so it is always necessary to search the Internet. I've collected some commonly used expressions here for the purposes of my memo. This post will be updated at any time, please continue to pay attention to this site.
Matching regular expressions for Chinese characters: [\U4E00-\U9FA5]
Match Double-byte characters (including Chinese characters): [^\x00-\xff]
Ap
Because of my previous period of time XMLHTTP batch crawl remote information articles
Http://blog.111cn.net/babyt/archive/2004/09/08/98516.aspx
Recently someone asked me how to save the article in text format instead of using HTML directly, which would save database space. So I wrote this function to remove the HTML tags from the text.
The function is simple, but
By default, form elements are distributed across different rows. The following code:We look at the code above is not much the same as HTML, but because the Struts2 form defaults to a separate row for each element in the form, the label property is just like the text label in HTML that precedes the However, after setting theme= "simple", the label property of the form element will be invalidated, then we hav
web| Insert | online
Previously thought that the web's online editor is nothing more than the substitution of input content and the quick insertion of HTML code, but do find that although the principle is that, but the implementation method is not as rigid as I think. Because it's very rare to do something on the UI, it's only now known that there are execcommand methods in document to solve the problem of inserting
In fact, there are a lot of HTML tags is very rich Yu Yuyi, and in the table layout of the way, many of the semantic label slowly forgotten by people. For example, many people may not have seen the tags once: DL, DT, DD, cite, q, DFN, ins, Del, VAR, and so on.
1. DL, DT, DD series definition list
Website refactoring let a lot of people know the UL, Ol and Li, b
Path to full-stack JavaScript (19th) html 5 insertion of html tags (1) innerHTML and outerHTML, html5outerhtml
It is difficult to use DOM operations to insert a large number of html tags to a document. You must not only create a series of nodes, but also carefully link them
example
fontTags) or the type that is harmful to availability (for example
blink). Tag
The following are some of the tags you may often encounter that have better options:
bIt can be used to generate bold elements. Use
strong(Meaning strong emphasis) instead of more meaningful, or use CSS to do this, increase
font-weight: boldTo indicate the bold elements.
iIt can be used to generate italic elements. Use
em(Emphasize), which is more meaningful. You c
CSS advanced layout has gradually become popular, but in the face of the so-called div+css layout of the people more worried, do not let div become a substitute for table, multi-layer nested div will seriously affect the readability of the code, using HTML to provide us with the tag bar.
When should you use div?
Although there are no hard rules in this regard, the individual believes that Div is more suitable for the general framework of the positio
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.