I started with a typical 1 file per page site and added ajaxify: http://www.barznoble.com/ (*warning*: auto-playing music)
Then I redid it as a single page using the history api: http://www.barznoble.com/2/ (no auto-playing music)
What I need is
A: for someone to look through the code of the 2nd version and give advice on how I could improve the way I have the code arranged.
B: suggest an actual front end javascript framework to rebuild it with a 3rd time.
Advice on refactoring a single page site
Moderator: General Moderators
-
- Forum Contributor
- Posts: 367
- Joined: Fri Jul 20, 2007 11:29 am
- Contact:
Advice on refactoring a single page site
Warning: I have no idea what I'm talking about.
- Christopher
- Site Administrator
- Posts: 13592
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: Advice on refactoring a single page site
Other than putting the CSS and Javascript in to separate files, that is too much code to give much advice on.
(#10850)
Re: Advice on refactoring a single page site
Minify. Separate your concerns, definitely, but minify your CSS and JS. Make sure images are optimized.
-
- Forum Contributor
- Posts: 367
- Joined: Fri Jul 20, 2007 11:29 am
- Contact:
Re: Advice on refactoring a single page site
(Referring to /2/ version) For development they are separate but I figured it might be faster to load all the html, css, and js in one shot on the live site.Christopher wrote:Other than putting the CSS and Javascript in to separate files, that is too much code to give much advice on.
I'll revert back to individual link and script tags to make it easier to digest and reply again when done.
Warning: I have no idea what I'm talking about.
- Christopher
- Site Administrator
- Posts: 13592
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: Advice on refactoring a single page site
Instead, think of what the browser will cache. Especially for data driven pages where a parameter or session data will require that the page is sent. Having the CSS and Javascript separate greatly reduces what needs to be sent.thinsoldier wrote:(Referring to /2/ version) For development they are separate but I figured it might be faster to load all the html, css, and js in one shot on the live site
(#10850)