pre-rendered vs client-side processed javascript

P

PJ6

CSS pseudoclasses are too limiting at the moment (epspecially for IE), so
when I'm authoring say, a grid control, I believe there are only two
possibilities - one, emit javascirpt for each cell, or two, emit javascript
to wire up events to each cell client side. I've read a lot about the
benefits of using the second approach because it "saves bandwidth"... but
really. That's trivial unless you have a large number of rows, in which case
you have a poor presentation design. Which approach is best for performance
client side? I would be inclined to say the first but before I go ahead and
test: this question has probably already been asked and answered; what's the
commonly accepted best practice?

Paul
 
S

Steve C. Orr [MCSD, MVP, CSM, ASP Insider]

The commonly accepted best practice is the second approach.
Even if you don't have very many rows, if you multiply that by however many
page requests that page will receive then it adds up.
It also keeps the page output tidier by having the JavaScript in one place
instead of scattered all over.
As far as client side performance then I don't think there's any significant
difference between the two approaches unless you consider the slower page
load time of option #1.
 
P

PJ6

Well now that I'm doing it that way, rather than inheriting from Table and
populating it server-side, I'm inclined to pass raw data to a javascript
function and build the table client-side instead. Is that acceptable design
practice?

Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top