PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Tue Sep 26, 2017 6:11 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Tue Apr 26, 2016 5:32 pm 
Offline
Forum Contributor

Joined: Fri Jul 20, 2007 11:29 am
Posts: 332
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.

_________________
Warning: I have no idea what I'm talking about.


Top
 Profile  
 
PostPosted: Tue Apr 26, 2016 5:48 pm 
Offline
Site Administrator
User avatar

Joined: Wed Aug 25, 2004 7:54 pm
Posts: 13431
Location: New York, NY, US
Other than putting the CSS and Javascript in to separate files, that is too much code to give much advice on.

_________________
(#10850)


Top
 Profile  
 
PostPosted: Tue Apr 26, 2016 6:44 pm 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6353
Location: Montreal, Canada
Minify. Separate your concerns, definitely, but minify your CSS and JS. Make sure images are optimized.

_________________
Supported PHP versions No longer supported versions


Top
 Profile  
 
PostPosted: Tue Apr 26, 2016 7:05 pm 
Offline
Forum Contributor

Joined: Fri Jul 20, 2007 11:29 am
Posts: 332
Christopher wrote:
Other than putting the CSS and Javascript in to separate files, that is too much code to give much advice on.


(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.

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.


Top
 Profile  
 
PostPosted: Wed Apr 27, 2016 12:25 pm 
Offline
Site Administrator
User avatar

Joined: Wed Aug 25, 2004 7:54 pm
Posts: 13431
Location: New York, NY, US
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

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.

_________________
(#10850)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group