[Tut] OS Detection in JQuery
2 posts
Page 1 of 1
All you really need to know is that js/jquery-1.3.2.js adds in JQuery to your html page, and that js/jquery.client.js has the codes inside it to detect your OS, as well as your web browser.
These are the codes that belong in your index.html file.
These are the codes that belong in your index.html file.
Code: Select all
There is also navigator.platform.
<html>
<body>
<div id="os"></div>
<script src="js/jquery-1.3.2.js"></script>
<script src="js/jquery.client.js"></script>
<script>
$('#os').html("<strong>Operating System</strong>: " + $.client.os + "");
</script>
</body>
</html>
Code: Select all
document.body.innerHTML = "<strong>OS:</strong> " + navigator.platform;
Last edited by mikethedj4 on Sat Oct 03, 2015 11:26 pm, edited 2 times in total.
You can also get the operating system from the navigator.platform and navigator.appVersion objects.
2 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023