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 Introduction to HTML and CSS (2016) 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>