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

General Discussion

Looking for feedback on an HTML5 web app

I am creating a web app that does complex calculations found in a role playing game (GURPS 4e). I would appreciate any feedback.

http://apps.jamaxxtest.com/gurpsulator-demo/

If anyone is interested in viewing any of the code let me know and I will post it.

3 Answers

Hi Richmond,

I checked out your site and it has a good look. When I click on the calculate button the menu just closes though. Am I supposed to see the results of the calculation? Or, is that not done yet? I am using Firefox 33 on Ubuntu 14.04. Also, have you considered using angularjs for your calculations? It seems to me that angular may be well suited in this situation. I like the comments I see in your javascript code and your variable naming seems to be spot on. Your nested conditionals are kind of deep. If they get more complicated in the future you may want to consider employing a design pattern like State to keep track of everything.

I hope you find my feedback helpful.

Paul

Hi Paul, Thank you for the feedback. Earlier on I did have a problem with the calculator sections closing when a calculator button was clicked, but I thought I had fixed the problem (using the preventDefault() function). You should be seeing the results posted below the calculate button and only clicking on one of the main calculator menu buttons should cause anything that is open to close. But I had only tested it on Chrome and Internet Explorer.

Sure enough when I view the app in Firefox I have the same problem you did. Thank you for bringing that to my attention. I will work on making the code compatible with Firefox and while I am at it I should probably test it in Safari just in case. I assumed that because I was using Jquery, I would not run into any browser compatibility problems.

In the meantime, if you use Chrome or IE you will be able to use the app and see the results.

Yes my conditionals do get crazy. If you are familiar with GURPS, some of the calculations get very complex with a lot of conditional applications (which is why I thought this app would be so handy), so in trying to cover all the possible conditions things got crazy in a few places. I actually still have some testing to do before I can know for sure that my conditionals are actually covering all the possible results. LOL.

The bug causing the menu to close when viewing with Firefox is now fixed. I neglected to put an argument for an event into the anonymous function for .click, which I could then use for the event.preventDefault() . Chrome and IE were forgiving about this and worked the way I had intended, but Firefox was saying "No $#@*ing way!!"

It is all good now. Thanks again to Paul for pointing this out.

Unfortunately... when I tested in Safari, there was styling issues with menu buttons , which was no big deal, and the menu won't open at all when buttons are clicked (much bigger deal).

I think this may be a much harder bug to fix than the last one.

I have fixed the styling issues with the Safari browser and by updating my Safari to the latest version I am able to open the menu and use the calculators. It still does not work exactly as intended. When a new menu button is clicked in Safari a new calculator is opened, but the previously opened calculator does not close. If you click a second time on any open menu button, it will close though, so I am torn as to whether I need to fix the incompatibility. It is not what i intended, nor is it similar to how it works in other browsers, but it is functional.