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

Douglass Smith
Douglass Smith
2,083 Points

embedded elements...

I was going through this area and was practicing copying code from another you tube site to see how it worked out. I use the sublime text editor, copied, pasted all the embedded code from the youtube video and placed it into the body element of my practice file. Saved it and when I went into my chrome browser and refreshed the video would not appear on the page? Any thoughts would be most appreciated...thanks

6 Answers

dan schmidt
dan schmidt
2,576 Points

The treehouse workspaces are decent. They automatically deploy your project's code to a live web server so all your examples will run in the proper context, i.e. via a web server, rather than viewing the files locally in your brower.

Plunker and the other web editors are good choices for small examples and experiments as well, because they to serve your files via a web server. They also have some nice convenience features, like being able to select 3rd party libraries to include and being able to save examples and easily share them with others.

When it comes to your editor of choice and local dev environment, this should be viewed as another skillset you need to learn, just like any other technology, such as html, css, javascript, etc. You will need to spend time going through the growing pains of learning your editor and the other tools as well. That being said, I know all to well how frustrating it can be when you add this into all the new things you are trying to learn simultaneously.

My advice would be to use the treehouse workspaces when your following with one their courses, use plunker/codepen/whatever when you just want to try something out, and use your editor when you're working on your own projects. Let me emphasize that it is worth your time to build up your skills with your local dev enviroment, but I would only begin putting more time into it once the online options begin holding you back.

Hope this helps. Feel free to hit me up at my twitter sometime if you have more questions: @codeswish

dan schmidt
dan schmidt
2,576 Points

Open DevTools in your brower first then refresh the page. You will probably see an access control allow origin error in big red letters. This is a security measure when opening up files locally in chrome so scripts cannot download unauthorized scripts over the net that will be executed locally.

dan schmidt
dan schmidt
2,576 Points

In DevTools you will see the error in the javascript console.

Douglass Smith
Douglass Smith
2,083 Points

I found the error message...how should I proceed from there? thanks Dan

dan schmidt
dan schmidt
2,576 Points

You could try the code on codepen, jsbin, jsfiddle, or plunker.

Here is an example i just threw up: http://plnkr.co/edit/YvKiI5fg8GJmUTCynCoV

You could also do...

It probably will work if you serve the page from a locally run webserver.

If you are on Mac or Linux, you will have python installed by default, which would you allow to do the following:

$ cd YOUR_PROJECT_DIRECTORY
$ python -m SimpleHTTPServer

Then in your browser you go to the url: http://localhost:8000

Douglass Smith
Douglass Smith
2,083 Points

Went into plunker as per your example. Placed my practice coding in their editor and it worked fine...thanks. Do you think their would be any problem in in continuing to use their editor when I'm doing the Treehouse site instead of the Sublime editor or should I stick with that? Any thoughts also on using the new editor from Treehouse? Thanks Dan for your help and time as I'm quite new to actual coding side of web development and design. Thanks again...

Douglass Smith
Douglass Smith
2,083 Points

Thanks so much Dan for your great advice! I appreciate all your help in responding as well. It is a little frustrating when your trying to start out in a completely new direction and hoping its a worthwhile pursuit in the end of it all so thank you once again. Have a good one...

Sincerely, Doug Smith