This is used in the development of applications, at first thought with the PHP tutorial now realized, now suddenly think of the indexof with JS can be an example, the code is as follows.
js to determine if the address contains parameters
Provide a JS tips tutorial results, mainly used for pictures, text when-the mouse after a small hint of information, leaving automatically disappear.
Normal link or button tips
Today we talked about the character replacement function of JS replace the details, mainly about his replacement of simple characters and the use of regular expressions to deal with character replacement, there is a need for friends to see.
The
JS Odd or even line highlighting and mouse across the highlight display
function addclass (elem, value) {if (!elem.classname) {Elem.classname = value;}else {var newclass = Elem.classname;Newclass + = "";Newclass + = value;Elem.classname = Newclass;}
Two methods of distinguishing Chinese and English characters by using regular and charCodeAt ()
Please enter the characters in the following form and click outside the form area judged by Regular Expressions: Judged by charCodeAt () method:
Simple JS Gets the method of element style attribute value
function Attrstyle (elem,attr) {
if (Elem.style[attr]) {
If the style exists in HTML, it takes precedence to get
return elem.style[attr];
}else if (elem.currentstyle) {
IE
JS for in browser differences
var obj = {
2 2: "2",
3 40: "40",
4 15: "15",
5};
6 for (var k in obj) {
7 Console.log (k);
8};
Ie6/7/8/firefox/safari24015
Ie9/chrome10/opera1121540
That is, the IE9/CHROME10/OPERA11 is not output in the
JS Detection browser to style support methodvar Getstyleproperty = (function () {
var prefixes = [', '-ms-', '-moz-', '-webkit-', '-khtml-', '-o-'];
var reg_cap =/-([A-z])/g;
function Getstyleproperty (CSS tutorial, el) {
el = El | |
Inserts the specified HTML fragment at the front, back, first child element, and after the last child element, four places before a DOM element. Other browsers support it successively. Only Firefox does not support, even the newly released ff4.
An example:Copy code code as follows:
When the page containing the above code is opened, it does not load "tt.jpg" and is loaded when the button is clicked. Triggers the onload event to appear on the page when the load completes. If you are loading
Do While and while detailed
While...wend statement
A series of statements are executed repeatedly, as long as the specified condition is true.
Grammar
While condition[Statements]
Wend
The syntax for a while...wend statement has the following
I. Reasonable internal chain optimizationHow to optimize the website's internal link? Internal optimization focuses on the principles of precision, simplicity, smoothness, and relevance. "Refined" does not have useless links for dilution keywords,
I. Cheating means are unavailable, and the rankings will drop againAs we all know, there are two key optimization ideas in the SEO optimization industry: Black box optimization and white box optimization. Some people use black box optimization,
High-weight linksLink !!! Isn't it an external chain? This should be explained. Generally, external links are unidirectional, and links are bidirectional. Some people also want to retain the weight of the website, exchange between Station a and
2. LinksLet's talk about the misunderstanding of friendship links. Many people think that when you have high-quality links, the increase in website weight is very helpful. This is either correct or incorrect. This distinguishes the attitudes of
Analyze external linksSomeone may say, "is daily analysis useful? So what is the effect of ordinary analysis !" I tell you that analyzing external links every day is a must for optimizing websites! Many optimization beginners will ignore this. Let
I. Website mate meta tag.Be sure to write the correct tag for your webpage, and the tag should naturally contain the keywords you have made. Note: for different webpage content, you need to work out appropriate tags to improve the coverage of your
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