Thu Jan 17, 2013 9:02 pm
<html>
<head>
<title>Get the type of browser or device visiting your website</title>
<!--
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js">
</script>
Note you can download the JQuery package instead of using Google version. -->
<script src="jquery-1.8.3.js"></script>
<script>
jQuery(document).ready(function($){
var deviceAgent = navigator.userAgent.toLowerCase();
var agentID="";
if (deviceAgent) {
$("#agent").html(deviceAgent);
agentID = deviceAgent.match(/(mozilla)/);
if(agentID) {
$("#agent").append('<br/><u>do something for this firefox</u>');
}
// Check if client is a Iphone,ipod,ipad
agentID = deviceAgent.match(/(iphone|ipod|ipad)/);
if(agentID) {
$("#agent").append('Handle mobile events');
}
}
});
</script>
</head>
<body>
<b> Get the type of brower ( Client Agent ), current client: </b>
<p id="agent">
</p>
</body>
</html>
Fri Jan 18, 2013 1:38 pm
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.