There are many cases in which we need to get exact information about the client on which the code we wrote in JavaScript is running. Getting the information we need out of the user-agent is not straight forward. Using the UAParser.js lightweight JavaScript library it becomes much simpler.

The following demo shows how simple it is to us this library in order to get the exact information we need out of the user-agent.

<!DOCTYPE html>
    <title>UAParser.js Demo</title>
    <script type="text/javascript" src="ua-parser.min.js"></script>
    <script type="text/javascript">
        var parser = new UAParser();
        var result = parser.getResult();

The following video clip overviews this code sample, shows its execution and explains it.

You can find more code samples, slides and video clips for learning this library in my free online courses website at

Leave a Reply

Your email address will not be published. Required fields are marked *