Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.


AaronDavid Hammond
AaronDavid Hammond
6,303 Points

In a video Nick mentioned that using javascript to display an img might not work for a content parser. Content Parser?

In a video I just watched on responsive images, Nick mentioned that using javascript to display an img. might not work for a content parser. What is a content parser?

1 Answer

Paul Yabsley
Paul Yabsley
46,713 Points

I think he probably means a piece of software which automatically looks at the html on a page and gets (parses) the content. A search engine, for example, might look at the markup of a web page in order to index it. Or something like the built in reader view in mobile safari which strips out everything but the text. It has to parse the content in order to work out what to keep.

If an image is displayed using javascript at the time of the page loading then it might not be there when a content parser looks at it as they don't work by loading the page in the same way as a browser.