Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
libai
/
footsen
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
7e91aa72
authored
3 years ago
by
agan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交
parent
19defae3
master
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
mTest.html
mTest.html
View file @
7e91aa72
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<title>
Document
</title>
</head>
<body>
<div
id=
"contain"
></div>
<script>
var
c
=
document
.
getElementById
(
"contain"
);
c
.
innerHTML
=
window
.
location
.
href
+
"
<
br
>
" + navigator.userAgent.toLowerCase();
var br = navigator.userAgent.toLowerCase();
var browserVer = (br.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [0, '0'])[1];
userBrowser();
function userBrowser() {
var browserName = navigator.userAgent.toLowerCase();
if (/msie/i.test(browserName) && !/opera/.test(browserName)) {
alert("
IE
");
return;
} else if (/firefox/i.test(browserName)) {
alert("
Firefox
");
return;
} else if (/chrome/i.test(browserName) && /webkit/i.test(browserName) && /mozilla/i.test(browserName)) {
alert("
Chrome
");
return;
} else if (/opera/i.test(browserName)) {
alert("
Opera
");
return;
} else if (/webkit/i.test(browserName) && !(/chrome/i.test(browserName) && /webkit/i.test(browserName) && /mozilla/i.test(browserName))) {
alert("
Safari
");
return;
} else {
alert("
unKnow
"
);
}
}
// alert(navigator.userAgent);
</script>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment