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.

HTML Introduction to HTML and CSS Adding a New Web Page Write the HTML

Sam Weeks
seal-mask
.a{fill-rule:evenodd;}techdegree
Sam Weeks
Front End Web Development Techdegree Student 16,699 Points

placeimg.com wont refresh new img or display at all on one of my pages i've used the java script code no luck

<h1>Resume</h1> <img scr="http://placeimg.com/200/200/tech" alt="Sam Weeks, Web Developer">

<img src="https://placeimg.com/400/400/any" alt="Drawing of Jane Smith" class="profile-image">

first link wont open up any image at all 2nd will only upload once until i clear my cache and cookies

i've tried the javascript code on other answered questions similar to this but still no luck any feed back would be most appreciated

4 Answers

browsers generally cache css files to increase performance. If you want it to clear every time you could use a cache buster, you can do this with php, js or sass (for bg imgs). If you just want to clear the cache for working on your local computer you can just modify your browser settings.

Your first link has a typo, scr should be src

Sam Weeks
seal-mask
.a{fill-rule:evenodd;}techdegree
Sam Weeks
Front End Web Development Techdegree Student 16,699 Points

thank you deebird i did change this and place-img still didnt seem to register, once it uploaded one image it wouldn't refresh to another random one like its supposed to generate.

Are you doing anything to prevent caching?

Matthew Jergens
Matthew Jergens
4,066 Points

I found the following script on another Treehouse forum, and it fixed the problem for me. <script> document.querySelector("img").src += "?nocache=" +Math.random();</script>