Login   Register  
Icontem

File: simple_example.html

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Arturs Sosins  >  Mobile Detect  >  simple_example.html  >  Download  
File: simple_example.html
Role: Example script
Content type: text/plain
Description: Detect if visitos uses mobile device
Class: Mobile Detect
Detect if the user browser is on a mobile device
Author: By
Last change:
Date: 2012-11-27 14:24
Size: 1,263 bytes
 

Contents

Class file image Download
<!DOCTYPE html>
<!--
/*************************************************************
 * This script is developed by Arturs Sosins aka ar2rsawseen, http://webcodingeasy.com
 * Feel free to distribute and modify code, but keep reference to its creator
 *
 * Glint effect provides you an ability to add glint effect 
 * to different HTML objects, which can append canvas element
 *
 * For more information, examples and online documentation visit: 
 * http://webcodingeasy.com/JS-classes/Javascript-glint-effect
**************************************************************/
-->
<html>
<head>
</head>
<body>
<p>Are you using mobile device?</p>
<p id='answer1' style='font-weight: bold;'></p>
<p id='question2'>What type of browser/device are you using?</p>
<p id='answer2' style='font-weight: bold;'></p>
<script type="text/javascript" src="./MobileDetect.packed.js" ></script>
<script type="text/javascript">
var md = new MobileDetect();
if(md.isMobile())
{
	document.getElementById("answer1").innerHTML = "Yes";
	document.getElementById("answer2").innerHTML = md.getMobile();
}
else
{
	document.getElementById("answer1").innerHTML = "No";
	document.getElementById("question2").style.display = "none";
}
</script>
</body>
</html>