Syntax for indexOf methods in javascript: Thestring.indexof (Substring,[n]). It looks for a routed substring in the specified string object, and if you specify parameter n, it can start the search forward (from left to right) from the specified position. Returns the position of the substring in the string if a substring is found, or 1 if no corresponding string is found.
Using this property, we can call it a lot of work, as long as you command it properly.
First, the evaluation of the OS
Although the HTTP protocol is cross-platform, the final display of HTML pages you write is often related to the operating system used by the client. For example, the MSOs series (Ms-dos,windows 9x/nt, etc.) for the text "another line" is defined as "carriage return add line", but the Mac as long as a "return" is enough, and Unix/linux only use "line break". This way you can export some of the things you want to branch in a certain page that may result in a "compatibility" problem ... Okay, look at the following example:
First step: Insert the following script at a location in the page:
Step two: On the page body (...). ) is used in:
Second, judge the browser
Browser compatibility issues have been plagued by the vast number of Web page writers, there are many solutions to this problem, but I think the most thorough, most effective measures for each major browser to write a page version, which is almost perfect. Try the following code, which will help you bring your visitors to the page that corresponds to the client browser:
...... Between-->
Third, determine the location of the page
Now online "copy + paste" method is very popular, we also have no way to let their own site is not copied, but some people are too lazy, they even copy time are reluctant to spend, directly to your page frame to their page to the ... Of course, you can also use the method of judging the frame name to prevent this problem, but if your page is to be used by many frames page, this is not more stupid? Look at the following simple and short code, I believe it will be useful ... Between-->