Debugging and Fixing Common JavaScript Errors

Challenge 7: Uncontrolled Changes

Debugging and Fixing Common JavaScript Errors

Check out a free preview of the full Debugging and Fixing Common JavaScript Errors course

The "Challenge 7: Uncontrolled Changes" Lesson is part of the full, Debugging and Fixing Common JavaScript Errors course featured in this preview video. Here's what you'd learn in this lesson:

In this challenge, students attempt to find out how to resolve a bug resulting from a third party vendor's code.

Preview
Close

Transcript from the "Challenge 7: Uncontrolled Changes" Lesson

[00:00:00]
>> So that is your exercise, debug this error. Why are we getting form.submit is not a function? And how can we go about fixing this error without changing analytics.js? Because we'll all be in situations where there'll be things happening because of third parties that you can't ask Stripe to change their code, or Twitter to change their code, or whatever.

[00:00:25]
Any questions before we get started, yeah?
>> There's a question from Alex and Karina online about, first of all, does HTTP/2 eliminates some of these threading issues?
>> Maybe, all right, so the question is, does HTTP/2 eliminate some of these performance issues? Yes, HTTP/2 handles the the streaming of network of subresources differently than HTTP.

[00:01:01]
If possible, it's going to set up a more stateful connection and start streaming multiple assets down. The optimization steps that you will take to optimize for HTTP/2 versus HTTP are slightly different. However, not all of the web has converted to HTTP/2 and probably won't for a while yet.

[00:01:25]
And so you're gonna have clients on both sides. So which one do you want to optimize for? What I had optimized for was nothing at all. So it was not going to be good for either. Because even if it was HTTP/2, I still would have gained a bunch of advantages on compressing the assets and setting the proper caching headers.

[00:01:42]
But I might not get as much from combining them all together. Look at your asset payload and target what your browser clients are going to be communicating with, and tailor your app to be best suited to them. That's a really good question. Anything else? All right, so this next exercise is Exercise 7.

[00:02:07]
So this is a third party error. So go to the signup page, try and submit the form and troubleshoot the error. But you cannot change analytics.js or any JavaScript file in the vendor directory.

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now