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.

JavaScript JavaScript Basics (Retired) Introducing JavaScript Your First JavaScript Program

Trent Sturgill
Trent Sturgill
2,441 Points

First "alert" works....second one does not! What am I doing wrong?

Hello all,

Please see the link for my workspace:

https://w.trhou.se/ld78kl2sk1

Anybody have any idea why my second alert wouldn't be popping up? I've checked my code at least a dozen times, and still no avail. Thanks in advance!

4 Answers

Laurie Williams
Laurie Williams
10,174 Points

I think my browser is caching the page. Check your cache.

I've confirmed this with Safari, so this may be true for other browsers as well - sometimes the browser will cache your code.

  1. Select Safari > Clear History and Website Data...
  2. Select "the last hour" from the dropdown menu and click "Clear History" to confirm.
  3. Click the preview icon in your workspace again.

Your script worked fine in my JS console in Chrome.

Working fine for me also

John McCall
John McCall
2,630 Points

Do you have some sort of pop-up blocker? Chrome asks me if I want to disable "alerts" from this page....