knewhouse/aash — pull request #1 by ngoldman (2014-01-05 03:57:34+00:00)
Title: code review, lil help

Hi Kari!

I did a few things:

1. The formatting was pretty inconsistent (tabs and spaces of different sizes) so I normalized all of that. It seems like you were using tabs more than spaces so I went with that. This just made it a lot easier for me to read and work with.
2. I added a `.gitignore` file to your project to make sure no unnecessary files were committed from my computer (like hidden icon thumbnail files).
3. I got rid of the old `tables.js` file since it looks like you're no longer using it.
4. I moved all of the inline style out of `demo.html` and into `main.css` -- inline style is bad! It overrides any styles you have in your stylesheets and it's generally considered to be a bad practice. [This cool lady](http://0.tqn.com/d/g/5105.jpg) who is probably not a robot wrote an article about it [here](http://webdesign.about.com/od/css/a/aa073106.htm).
5. I took all of the inline script tags out of `demo.html` and consolidated them into one file -- `main.js`. This is also a best practice issue and makes code more readable/maintainable.
6. I wrapped all of the logic in an [Immediately-Invoked Function Expression (IIFE)](http://benalman.com/news/2010/11/immediately-invoked-function-expression/) -- this helps keep any variables or functions out of the global namespace. Polluting the global namespace is bad! That's why IIFEs are good.
7. I rearranged some of the code -- third party library extensions, variables, and functions are all at the top, logic that's not dependent on the DOM being loaded is in the middle, and logic that needs to be run after the DOM is finished loading (for example anything that needs to manipulate HTML elements with jQuery) is at the bottom, wrapped in a `$(document).ready()` statement.
8. I changed some of the HTML and JS so that your form can be submitted with a click or by pressing enter. This involved wrapping the input and button in a form element and changing the jQuery statement to use a `.submit()` handler (more info [here](http://api.jquery.com/submit/)).

There are still some issues I saw at first glance. It looks like you're using several query parameters with weird names that maybe you don't need -- "fdop", "fdnq", and "fdtq" don't sound like anything related to sports memorabilia certification. Maybe these came from a tutorial? It looks like you might have some extra logic and HTML elements that you don't need either.

As for making it responsive, that table is generated by Google's Spreadsheets API so I'm not sure how to modify that style after the fact in an efficient way (they use inline styles which creates a giant mess). The best thing to do would be to request the data in plain JSON and then put it on the page yourself without needing to load Google's huge and somewhat crappy visualization library.

That's all for now, hope that helps!