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 trialFito Lazare
4,349 Pointsmy 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
Fito Lazare
4,349 PointsThank you. I got it..
5 Answers
Tarran Prior
Courses Plus Student 3,169 PointsHey 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
4,349 PointsThanks, is there a way to permantly shut down the cache collection? would you recommend it?
Dmitry Polyakov
4,989 PointsIt's working when you put it into an address box in a browser. Maybe you missed some quotation mark
it should be like this
Fito Lazare
4,349 PointsI 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.
Dmitry Polyakov
4,989 PointsWhat's your new src link?
Fito Lazare
4,349 Pointshttp://placeimg.com/400/400/nature
I did it like she did but I used nature instead.
Tarran Prior
Courses Plus Student 3,169 PointsTarran Prior
Courses Plus Student 3,169 PointsNo 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. :)