Welcome aboard! We are happy you are here and wish you good net-raft!
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-2.1.3.min.js " type="text/javascript"></script>
<script src="/Script.js " type="text/javascript"></script>
</head>
<body>
<div></div>
<script type="text/javascript">
$(document).ready(function(){
$('div').DetectDevice();
});
</script>
</body>
</html>
// this will be placed in Script.js
(function ($) {
$.fn.DetectDevice = function () {
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
if (screen.width <= 768) {$(this).text("mobile device");}else{$(this).text("tablet");}
}
else {
$(this).text("other device");
}
return this;
};
})(jQuery);
The most helpful JQUERY solutions
plugin get client ip address using jqueryJQUERY Click to see more ... 10.9K 1.8K