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 trialnvcxnvkldsjaklfds
Courses Plus Student 5,041 PointsObject element does not work
I copied the embed code from youtube to display on webpage. But it does not work in Chrome, IE9 and SeaMonkey.
3 Answers
Jason Anello
Courses Plus Student 94,610 PointsHi Karthikeyan,
If you're testing this locally then the protocol-less url won't work. You have to add http:
in front of the url's for both the object
and embed
tags
Ben Falk
3,167 PointsYou may need to post the code you are using, and how you are using it (embedded within HTML? Within a CMS such as Wordpress?) I've used YouTube's embed codes before, and they have always worked fine for me.
nvcxnvkldsjaklfds
Courses Plus Student 5,041 PointsThis is code I used: I used them inside HTML
<object width="560" height="315">
<param name="movie" value="//www.youtube.com/v/EisZTB4ZQxY?hl=en_US&version=3&rel=0"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param>
<embed src="//www.youtube.com/v/EisZTB4ZQxY?hl=en_US&version=3&rel=0" type="application/x-shockwave-flash" width="560" height="315" allowscriptaccess="always" allowfullscreen="true"></embed>
</object>
Ben Falk
3,167 PointsI'm not sure if the forum stripped out your code? Make sure to look at the "Markdown Cheatsheet" link below, and enclose any code within three backticks so the forum understands it properly.
nvcxnvkldsjaklfds
Courses Plus Student 5,041 PointsPlease check now. I edited it to display the code.
Ben Falk
3,167 PointsWhen I do a test of the code:
http://falkendev.com/test/youtube.html
I'm not having any problems. I haven't checked SeaMonkey, but it's working fine for me in Chrome and IE11/IE9. Are you sure you are entering the code in an appropriate place in your HTML file, within the <body>
section? (check the source code in the link above).
nvcxnvkldsjaklfds
Courses Plus Student 5,041 PointsBen Falk Thanks. Jason Anello mentioned. I am testing it locally. So the URL in the value attribute and src attibute were with no protocol mentioned. So it did not work.
Now It is fixed by adding http protocol to them.
nvcxnvkldsjaklfds
Courses Plus Student 5,041 Pointsnvcxnvkldsjaklfds
Courses Plus Student 5,041 PointsThanks a lot Jason Anello. It got fixed now.