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

HTML HTML Objects Embedded Elements

Liban Shire
PLUS
Liban Shire
Courses Plus Student 4,147 Points

Why is Nick Pettit using Localhost on the HTML course?

I got confuses as the why the Youtube object video we put on the Html wasn't loading because it had to do with whether or not we were using Localhost.

<embed src="http://www.youtube.com/v/_OBlgSz8sSM?version=3&amp;hl=en_US" type="application/x-shockwave-flash" width="420" height="315" allowscriptaccess="always" allowfullscreen="true"></embed>

I had to change things from // to http:// for it to load properly because of the localhost mis confusion.

1 Answer

Iago Wandalsen Prates
Iago Wandalsen Prates
21,699 Points

I dont know the specific reason he was using localhost, but is generally good practice to develop simulating a web server. // means you will use the same protocol you are currently using, so if your site is http://, it will make a request for a file with the http protocol, and if your site is https:// it will make a https request. When you are not simulating a web server, the protocol isnt http, and using the same protocol (because you used //) will fail. Im not sure if thats what you asked, tried.