My general approach is "server-side first". Unless it's wildly easier to accomplish something client-side, then I think it makes sense to go for the consistency of server-side processing.
So taking a text file, doing some processing, and spitting out what should behave for the user as if it's a static HTML document, server-side PHP/Perl/DrugOfChoice sounds like the way to go.
Save client-side processing for the things it does much better than the server-side alternative; mostly, I think that means use JavaScript for browser-interactivity stuff that's easier to do in the browser.
Ken
-----Original Message-----
From: Code for Libraries [mailto:[log in to unmask]] On Behalf Of Nate Hill
Sent: Thursday, December 01, 2011 12:49 PM
To: [log in to unmask]
Subject: [CODE4LIB] server side vs client side
As I was struggling with the syntax trying to figure out how to use javascript to load a .txt file, process it and then spit out some html on a web page, I suddenly found myself asking why I was trying to do it with javascript rather than PHP.
Is there a right/wrong or better/worse approach for doing something like that? Why would I want to choose one approach rather then the other?
As always, apologies if I'm asking a terribly basic question.
--
Nate Hill
[log in to unmask]
http://www.natehill.net
|