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 (node) {}function doSomething2 (node) {} But th
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 of the labels
JSP custom tags can be used in the main two packagesjavax.servlet.jsp.*;javax.servlet.jsp.tagext.*;Customize the label As followsDefine user-tired User.java get set is not in the repeating.Private String UserName;Private Integer age;Private String Email;Public User () {This.username= "Zhang San";this.email= "[email protected]";this.age=28;}Create a custom Label class Userinfotag.javaPackage Com.test.tag;Import javax.servlet.jsp.JspException;Import Jav
Html1. PropertiesKey-value pairs written in the start tag2. Color① English②16 The code is made for example: #cccccc #ccc (abbreviated) #000000③rgba (0~255,255,255,0~1) 0~1 representing transparencyPath1. Absolute pathFind it from the rootE:\........\........\........\.......\........\wjj\aa.html2. Relative pathstarting from its own position , for example, itself called index.html .Wjj\aa.html./ Sibling folders can be omitted.. / parent Folder./wjj/ Next Level3. Entity entity symbols;Common (sp
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 function is the function to implement this function
?
function delete_htm ($SCR)
{
for ($i =0; $i {
if (substr ($SCR, $i, 1) = = "{
while
Maybe a lot of people read data from a database that doesn't require data to be HTML tags, but maybe one day you'll find that when we need to export HTML tags, the compiler automatically prints out the strings. That's what we can do.
Method 1:
The most commonly used method, using JS or JQ
JQ:
$ ("#div"). HTML ("
Js:
var Dobj=document.getelementbyid ("div");
dobj.innerhtml = "
Method 2:
When yo
In Web application development with the Spring MVC framework, we will use custom tags to perform some special functions under special requests.
In general, the content of a custom label can be implemented without accessing the service, so inheriting tagsupport, overriding the doStartTag () method, enables basic functionality.
eg. A custom label that implements the/** function of an HTML tag
* @Comment * @Author Ron * @date August 30, 2016 a.m. 9:02:56
innerHTML property if you want to get the contents of the label
Label object. InnerHTML: Represents the text between tags
Label object. InnerHTML = new data: To assign a value to the contents of a label
Bomb frame:
Alert (): a regular window
Confirm (): Pop-up window with a confirmation and cancellation
Prompt (): Popup with Input box
settimeout (func,n)//timer, n seconds after executing the program in Func, the unit is milliseconds
Cleartime
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 str;}The test found that this code can not filt
The IMG tags in the two attributes are Alt and title, for many beginners are still confused about the correct use of these two attributes, of course, part of this is due to IE browser. The correct use of these two properties in addition to improve the image search ability, in the user experience is also very helpful, the following is to say the concept of ALT and title and correct use.
Alt
The essence of this property is that the picture can not be
-, get DropDownList's text (Ddllist is the server-side DropDownList ID, generate the Name property equals Ddllist's Select label)
$ ("#ddlList option:selected"). Text ()
Second, get DropDownList value (Ddllist is the server-side DropDownList ID, generate the Name property equals Ddllist's Select label)
$ ("#ddlList"). Val ()
Third, get the RadioButtonList text (Rbtlist is the server-side RadioButtonList ID, generate the Name property equals Rbtlist of a set of input
). Horizontally centered. margin:0 Auto; (certainly not omnipotent)3, if you need to add a style to the contents of a label, you need to set display:block (common to navigation tags)4, FF and IE on the BOX understanding of the difference between the 2px is also set for float div in IE under the margin doubling and so on.5, the UL label below the FF default has List-style and padding. It is best to make a statement beforehand to avoid unnecessary troub
This example describes the way in which PHP clears all the unwanted tags in a string. Share to everyone for your reference. The implementation methods are as follows:
Many times you need to output some "pure" strings, that is, remove any impurities, such as Html tags, spaces and other text, the output of the summary is so, the following function can help you achieve a bit.
The PHP instance code is as foll
Usually we use Htmlspecialchars () to filter HTML, but the character of the HTML is escaped, the final display is the HTML source code.
Use Strip_tags () to get rid of HTML tags.
$str = ' href ';echo Htmlspecialchars ($STR);echo Strip_tags ($STR);
?>
Many of the home page has a small part of the article. Use Strip_tags () to remove HTML tags here. But we also have to consider what the code is,
xhtml| Tips
For some time, found that there are many people XHTML will not use, not only ordinary beginners, some programmers are not very clear how to write this XHTML, I here it is a number of common application problems to do a summary, but also can make everyone in communication, cooperation can form a tacit understanding.
XHTML has a lot of tags, but often use that is a few, also as long as the master of these several can be. Here we list: Div,p,
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 function is the function to implement this function
?
function delete_htm ($SCR)
{
for ($i =0; $i {
if (substr ($SCR, $i, 1) = = "{
while
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
Web|web Standard |xhtml
In principle, all the tags in an XHTML document should be structural tags, and the places that need to behave are controlled using CSS.To list a complete XHTML structure tag:StructureBody, head, HTML, titleTextABBR, acronym, address, BLOCKQUOTE, BR, cite, code, DFN, Div, EM, H1, H2, H3, H4, H5, H6, KBD, p, Pre, q, Samp, span, Stro Ng, VarLinkAListDL, DT, DD, OL, UL, LiFormform, input
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.