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) HTML: The Structural Foundation of Web Pages and Applications Image Tags

Fito Lazare
Fito Lazare
4,349 Points

my img source doesn't do the random pick.

I changed the source of the img file like instructed but it does pick a random pick every time I refreshed it. Please help. Thanks

Tarran Prior
Tarran Prior
Courses Plus Student 3,169 Points

No problem, happy to help!

I wouldn't recommend permanently disabling cache, as it's essential for efficient web browsing (such as loading frequently visited web pages faster.) But there are certainly ways to do it.

However, if you're using Chrome - a nifty feature can disable the cache while you're in developer mode. To do this, simply right-click the page with the 'placeimg' image, and select Inspect. You'll see several tabs along the top of the new window such as Element, Console, Sources etc. Select Network, and you'll see a checkbox below that reads "Disable cache."

You can then keep this checked until you've finished developing/testing the page. The 'placeimg' image will now change to a new image each time you refresh the page.

Most other browsers will also allow you to do this in a similar way. Let me know if you need any more help. :)

Fito Lazare
Fito Lazare
4,349 Points

Thank you. I got it..

5 Answers

Tarran Prior
PLUS
Tarran Prior
Courses Plus Student 3,169 Points

Hey Fito.

Your browser is most likely displaying a cached image rather than fetching a new image each time you refresh the page. You can solve this by clearing the cache in your browser. However, the next image that displays will also be cached.

In most browsers, you can temporarily disable cache by going into Developer Tools. If you'd like to know how to do this, feel free to ask. But you can be rest assured that this issue isn't at your fault. :)

Hope this helps!

Fito Lazare
Fito Lazare
4,349 Points

Thanks, is there a way to permantly shut down the cache collection? would you recommend it?

Dmitry Polyakov
Dmitry Polyakov
4,989 Points

It's working when you put it into an address box in a browser. Maybe you missed some quotation mark

it should be like this

src="http://placeimg.com/400/400/nature"

Fito Lazare
Fito Lazare
4,349 Points

I did all the quotation marks correct but I'll try to clean the cache and let you guys know the results. Thanks for the help Dmitry.

Fito Lazare
Fito Lazare
4,349 Points

http://placeimg.com/400/400/nature

I did it like she did but I used nature instead.