UAParser.js Jump Start PRO

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>
<html>
<head>
    <title>UAParser.js Demo</title>
    <script type="text/javascript" src="ua-parser.min.js"></script>
</head>
<body>
    <script type="text/javascript">
        var parser = new UAParser();
        var result = parser.getResult();
        document.writeln("<br>browser.name="+result.browser.name);
        document.writeln("<br>browser.major="+result.browser.major);
        document.writeln("<br>browser.version="+result.browser.version);
        document.writeln("<br>os.name="+result.os.name);
        document.writeln("<br>os.version="+result.os.version);
        document.writeln("<br>engine.name="+result.engine.name);
        document.writeln("<br>cpu.architecture="+result.cpu.architecture);
    </script>
</body>
</html>

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 http://abelski.lifemichael.com.

Share:

The Visitor Design Pattern

The Visitor Design Pattern

The visitor design pattern allows us to add operations to objects that already exist without modifying their classes and without extending them.

What are Anti Patterns?

Anti Patterns

Unlike design patterns, anti patterns just seem to be a solution. However, they are not a solution and they cause additional costs.

Virtual Threads in Java Professional Seminar

Virtual Threads in Java

The use of virtual threads can assist us with improving the performance of our code. Learn how to use virtual threads effectively.

NoSQL Databases Courses, Seminars, Consulting, and Development

MongoDB Design Patterns Meetup

The use of MongoDB involves with various cases in which we can overcome performance issues by implementing specific design patterns.

image of woman and database

Record Classes in Java

Learn how to define record classes in Java, and when to use record classes in your code. Stay up to date with the new Java features.

Accessibility | Career | Conferences | Design Patterns | JavaScript | Meetups | PHP | Podcasts | Python | Self Learning

Teaching Methodologies | Fullstack | C++ | C# | CSS | Node.js | Angular | Java | Go | Android | Kotlin | Swift | Academy

Front End Development | Scala | Architectures | Cloud | Big Data | Internet of Things | Kids Learn Programming

The Beauty of Code

Coding is Art! Developing Code That Works is Simple. Develop Code with Style is a Challenge!

Skip to content Update cookies preferences