into the autosavetimebox} Else {Var title = document. getElementById ('title ');If (title. value! = ''){Autosave_post ();} Else {Document. getElementById ('autosavetimebox'). innerHTML = 'do not save ';}This part means that when the sec> 0 condition is not true, the sec starts to save the draft.First, the system will judge whether the title of the article is null. if it is not empty, execute the autosave_post () function. Otherwise, the system will write 'Do not save'}Php Tutorial code
Var
JQuery is used to determine the browser type. The usage of the tool class $. browser is mainly used:
$. Browser. ['browser keyword ']
The Code is as follows:
$ (Function (){If ($. browser. msie ){Alert ("this is msie ");}Else if ($. browser. safari){Alert ("this is safari! ");}Else if ($. browser. mozilla){Alert ("this is mozilla! ");}Else if ($. browser. opera ){Alert ("this is opera ");}Else {Alert ("I don't konw! ");}
Let's take a look at the jQuery source code:
The Code is as follows:
detecting the user proxy string. The user agent string contains a large amount of information related to the browser, including the browser, platform, operating system, and browser version. The user proxy string has a long history. During this period, the browser provider view adds some deceptive information to the user proxy string to cheat the website details. User proxy detection requires special skills, especially when Opera conceals the user proxy string. Even so, the user agent string can
Judging the browser type in JS is probably a problem that every developer who edited the page has encountered. Among many browser products, ie, Firefox, opera, Safari ........ many brands have different standards. Therefore, you often need to perform different operations based on different browsers or even different versions of the same browser. Therefore, it is very important to know the browser's judgment method. The following lists common judgment methods:1. Determine whether the browser is I
, and browser version. The user proxy string has a long history. During this period, the browser provider view adds some deceptive information to the user proxy string to cheat the website details. User proxy detection requires special skills, especially when Opera conceals the user proxy string. Even so, the user agent string can still detect the rendering engine used by the browser and its platform, including mobile devices and game systems.
During each HTTP request, the user agent string is s
With the development of mobile networks, more and more people use mobile phones and other mobile terminals to browse Web pages for office work. If a large Alliance advertisement is displayed when the mobile phone opens the page, the user experience will be very poor, after some research, the following method is used to realize that mobile Browsers Do Not Display PC advertisements. I wrote a blog post about built-in browsers that do not display Alliance ads.
Determine whether the current browser
A singleton object that carries a list of common functions
The Code is as follows:
Var $ mfunc = function (){Return {// This function determines the browser type. For convenience, a digital representation is returned,// 1. ie6; 2. ie7; 3. ie8; 4. ie5.5; 5, Firefox; 6. chrome; 7. Opera; 8. Safari; 0. browsers that cannot be detected// Other browsers can addWhichOS: function (){Var useragent = navigator. userAg
ArticleDirectory
3 websites that detect browser User-Agent Information
3 websites that detect browser User-Agent Information
Judgment Principle:
Javascript is the main language for front-end development. We can compile JavascriptProgramTo determine the type and version of the browser. There are two methods to determine the browser type in javascript: one is to distinguish based on the unique attributes of various browsers, and the other is to judge by analyzing the
* @ Date: 01:34:31 */public class CheckMobile {// \ B is the logical interval between two (letter and non-letter) words ), // The string will be transcoded once during compilation, so "\ B" // \ B is the internal logical interval of the word (the logical interval between two letters) static String phoneReg = "\ B (ip (hone | od) | android | opera m (ob | in) I" + "| windows (phone | ce) | blackberry "+" | s (ymbian | eries60 | amsung) | p (laybook | alm | rofile/midp "+" | laystation portable)
Copy codeThe Code is as follows: var $ mfunc = function (){
Return {
// This function determines the browser type. For convenience, a digital representation is returned,
// 1. ie6; 2. ie7; 3. ie8; 4. ie5.5; 5, Firefox; 6. chrome; 7. Opera; 8. Safari; 0. browsers that cannot be detected
// Other browsers can add
WhichOS: function (){
Var useragent = navigator. userAgent. toLowerCase ();
Return (/MSIE
){......;} Else {Window. location. href = '/';}}} But this does not work. The original ff 3 is changed to xmlHttp. onreadystatechange = xmlHandle (); however, with parentheses added, IE does not work. Alas, FF was originally regarded as a chicken skin. Now I feel that FF is purely named as a "standard support, it is a waste of time for programmers. However, this program is really important, and there is no way to debug it again to see if there is a simpler way, as shown below:Copy codeThe Code
A few days ago, the browser family gave birth to a little prince, Google's Chrome browser. Because of the birth of Chrome, although he is still a little guy, no one dares to underestimate him. In the future, we often say that the browser's "Four talents" has to be renamed as "five golden flowers.In front-end development of websites, browser compatibility problems have left us in a hurry. Chrome's birth does not know how much trouble we need to add. Browser compatibility is the first problem to b
Author: nuysoft/high cloud QQ: 47214707 EMail: nuysoft@gmail.com
Disclaimer: This article is an original article. If you need to reprint it, please indicate the source and retain the original article link.
Read, write, or something wrong. Please tell me more about common progress.
6. browser test Support
The differences between browsers are too big. This chapter only introduces the basic idea of jQuery implementing browser compatibility and encapsulates interfaces after various differences. $. T
. The original ff 3 is changed to xmlHttp. onreadystatechange = xmlHandle (); however, with parentheses added, IE does not work. Alas, FF was originally regarded as a chicken skin. Now I feel that FF is purely named as a "standard support, it is a waste of time for programmers. However, this program is really important, and there is no way to debug it again to see if there is a simpler way, as shown below:XmlHttp. open ("GET", Url, false );XmlHttp. send (null );If (xmlHttp. status = 200)XmlHandl
= '/';}}}
But this does not work. The original ff 3 is changed to xmlHttp. onreadystatechange =XmlHandle ();However, with parentheses added, IE does not work. Alas, FF is a chicken skin, and now I feelFF is purely a title of "Supporting standards", but it is a waste of time for programmers.However, this program is really important, and there is no way to debug it again to see if there is a simpler way, as shown below:
XmlHttp. open ("GET", Url, false );XmlHttp. send (null );If (xmlHttp. status
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.