Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools Introduction to Front End Performance Optimization Combine and Minify Assets Optimize JavaScript

James Barrett
James Barrett
13,253 Points

Using the Network Tab to optimize JS HTTP requests - Need help removing them!

Hi there!

I am currently in the midst of developing a website for a youtuber and I am receiving three failed requests on the network tab:

https://i.gyazo.com/a24418e027859e13225c31a6cd62ebec.png

Now I believe it must be coming from this snippet of code:

  <div class="col" id="latest">
      <h2>View My Latest Video!</h2>
      <iframe width="300" height="200" src="http://www.youtube.com/embed?max-results=1&controls=0&showinfo=0&rel=0&listType=user_uploads&list=ThePokeRaf" frameborder="0" allowfullscreen></iframe>
    </div>

I came to this conclusion as I am noticing this in the headers tab:

https://i.gyazo.com/35f6cf0884d10138064e94cbb396c612.png

(it provides more or less the same information on each error)

I'm not really sure how to get rid of these requests and why they are actually there because my website is pulling through the latest video on a channel perfectly fine!

Thanks, James.

1 Answer

Steven Parker
Steven Parker
231,248 Points

:point_right: These requests are being made by the source of your iframe.

You can see them if you load the iframe source URL by itself. There's probably nothing you can do about that short of eliminating the iframe entirely.

James Barrett
James Barrett
13,253 Points

Ah okay, odd why it produces errors though as it loads through perfectly... I wonder if there are any alternatives to iframe for performance?