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

JavaScript

AJAX - Page Not Updating....

Please can someone help check these codes. It's thesame code used by Dave in AJAX 'employee' room example. But when I edited the 'employee.json' file and change 'inoffice' to 'true', the status of the employee refused to change to 'IN/GREEN' Also if I change an employee inoffice to 'false', the status remains thesame on the browser, even when I clear my web cache and reload the page.

INDEX.HTML http://imgur.com/a/bd20a

WIDGET.JS http://imgur.com/a/zwhth

EMPLOYEE.JSON http://imgur.com/a/ZCIay

....and please how do make the screenshot show here instead of just the links?

Here is a link to a Treehouse post on markdown syntax: https://teamtreehouse.com/community/howto-guide-markdown-within-posts

This is how you get images to appear in your post rather than the link. HOWEVER, it's very much preferable if you posted a link to either a github repo or a workspace snapshot (https://teamtreehouse.com/community/workspace-snapshots) or just pasted the text from your code into the question details. This way someone else can look at and run your code, you can't run code from an image.

I also recommend posting a link to the video from the course where you're having a problem, that way we can find the same place you're having a problem.

One other thing that might help, when I get really stuck sometimes what I do is download the project files with the completed code from the exercise, and then I compare my code to the teacher's code using a tool like this: https://www.diffchecker.com/ that way I can find the exact spot where my code is different and caused the error. But ideally it's better to debug without looking at the teacher's completed code, because you won't be able to do that in the real world.

This is the link to the course video: https://teamtreehouse.com/library/ajax-basics/jquery-and-ajax/the-office-status-project-revisited

I actually downloaded the project file and run it on my WAMP server. As I mentioned earlier, when I browsed to the index.html after changing the 'inoffice' property of an employee object to 'false' inside the the employee.json file, the browser status of that employee does not change accordingly.

Also did you restart your server? Unless you're using a server with a live-reload feature, you'll need to stop and restart the server after you make a change, otherwise you'll still be looking at the old version in your browser.

This is different from hitting refresh and clearing your cache.

Brenda, pls see the links to the codes above.

I see links to images, I don't see links to code. I can't run images.

Did you restart your WAMP server?

Here is the dropbox link to download the file: https://www.dropbox.com/s/sodhah664jvrfl3/video7.rar?dl=0

Thanks for your help Brendan.

I'm on a mac. It's a bit too much trouble for me to open a .rar file. Maybe there's a windows user who can help. But I still suspect the problem is that you need to restart your server, and that's not something anyone can help with by looking at the code, you'll need to stop the process in your terminal or using whatever program you used to start the server.

I run the WAMP server on my laptop and I've restarted my laptop severally since I've been battling with the code. I think it should have worked if it's all about restarting the WAMP server, but it's not still working....

I'm sorry I don't know the answer

Try a different browser. Maybe the caching is really stubborn.

Thanks Brendan, appreciate your effort. I hope there's someone in the forum who uses Windows machine and could assist..........