From the course: Vanilla JavaScript: Web Performance Optimization APIs
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Add the Navigation Timing API - JavaScript Tutorial
From the course: Vanilla JavaScript: Web Performance Optimization APIs
Add the Navigation Timing API
- [Narrator] Continuing with the project, it's time to replace our on-low handler here with the navigation time in API we're going to start using navigation time in API version 2 and then we will make a fall back. So for that, we need tracks their performance object and there, we need to get entries. In this case, by type. We're going to ask for, the type navigation we don't have frames here, so we don't need to add for frame And that will give us a list of entries, so let's create navigation entries. Let's create the constant for that, and then we're going to take those entries, and make a loop. So we're going to check every entry, and for every entry there, we're going to do something. In this case, there is only one entry usually for navigation, or no entries at all. So I can show access sub zero if tail for each and just in case let's other for each. And if it's zero, it's probably because it doesn't have the second version of the API. So once we are here, what we're going to do…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
Measuring our websites4m 18s
-
(Locked)
Add the Navigation Timing API5m 7s
-
(Locked)
Use the Resource Timing API4m 45s
-
(Locked)
Create custom user timing6m 7s
-
(Locked)
Get paint timing4m 31s
-
(Locked)
Detect long tasks3m 44s
-
(Locked)
Detect frame rate drops2m 39s
-
(Locked)
Add server timing information4m 11s
-
-
-
-