473,624 Members | 2,346 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

pre-rendered vs client-side processed javascript

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
Apr 4 '07 #1
3 1349
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.

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"PJ6" <no***@nowhere. netwrote in message
news:uW******** ******@TK2MSFTN GP05.phx.gbl...
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
Apr 4 '07 #2
PJ6
Well than that is how I will do it.

Thanks,
Paul

"Steve C. Orr [MCSD, MVP, CSM, ASP Insider]" <St***@Orr.netw rote in
message news:0F******** *************** ***********@mic rosoft.com...
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.

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"PJ6" <no***@nowhere. netwrote in message
news:uW******** ******@TK2MSFTN GP05.phx.gbl...
>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
possibilitie s - 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

Apr 4 '07 #3
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

"Steve C. Orr [MCSD, MVP, CSM, ASP Insider]" <St***@Orr.netw rote in
message news:0F******** *************** ***********@mic rosoft.com...
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.

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"PJ6" <no***@nowhere. netwrote in message
news:uW******** ******@TK2MSFTN GP05.phx.gbl...
>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
possibilitie s - 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

Apr 6 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3096
by: GriffithsJ | last post by:
Hi I have been given some text that needs to be displayed on a web page. The text is pre-formatted (includes things like lists etc) and displays okay if I wrap it using the <pre/> tag. However, the font used is rather "naff" and looks too different to the rest of my web page. I'm not sure how I can (or even whether I can) override the font used with the <pre/> tag. If not, is there another tag I can use to display pre-formatted...
3
3787
Pre
by: Neal | last post by:
A few questions about pre... When presenting preformatted text using the white-space: pre; property/value, Opera renders long lines at small viewport widths as exiting the borders of the element, IE6 extends the element to contain the line. Both necessitate horizontal scrolling. 1) Is one considered incorrect, or are both fair interpretations of the recommendation?
7
18527
by: Alan Illeman | last post by:
How do I set several different properties for PRE in a CSS stylesheet, rather than resorting to this: <BODY> <PRE STYLE="font-family:monospace; font-size:0.95em; width:40%; border:red 2px solid; color:red;
7
5026
by: Roderik | last post by:
Hi, When I use <pre> inside my <td> cells, the text won't flow to a new line and the table gets to large in width. This will appear in Firefox this way, Internet Explorer will wrap the lines, like I want, by default. Any idea what I should define to make firefox wrap the text inside the pre? <table><tr><td><pre>this is unwrapped in firefox</pre></td></tr>....<table> regards,
2
2782
by: Buck Turgidson | last post by:
I want to have a css with 2 PRE styles, one bold with large font, and another non-bold and smaller font. I am new to CSS (and not exactly an expert in HTML, for that matter). Is there a way to do this in CSS? <STYLE TYPE="text/css"> pre{ font-size:xx-large;
5
718
by: Michael Shell | last post by:
Greetings, Consider the XHTML document attached at the end of this post. When viewed under Firefox 1.0.5 on Linux, highlighting and pasting (into a text editor) the <pre> tag listing will preserve formatting (white space and line feeds). However, this is not true when doing the same with the <code> tag listing (it will all be pasted on one line with multiple successive spaces treated as a single space) despite the fact that...
1
4738
by: R0bert Nev1lle | last post by:
Here's my next IE challenge (or frustration). It deals with the overflow attribute. Overflow property was a challenge on my page since the page emulates position fixed for IE. The present scenario deals with the pre element. Sometimes the content in the pre container exceed the parent container's width. IE expands the parent containers width as a result. The workaround for this scenario relates to the overflow property and using a...
8
3776
by: Jarno Suni not | last post by:
It seems to be invalid in HTML 4.01, but valid in XHTML 1.0. Why is there the difference? Can that pose a problem when such a XHTML document is served as text/html?
7
2738
by: Rocky Moore | last post by:
I have a web site called HintsAndTips.com. On this site people post tips using a very simply webform with a multi line TextBox for inputing the tip text. This text is encode to HTML so that no tags will remain making the page safe (I have to convert the linefeeds to <BR>s because the Server.EncodeHTML does not do that it seems). The problem is that users can use a special tag when editing the top to specify an area of the tip that will...
9
5539
by: Eric Lindsay | last post by:
I can't figure how to best display little snippets of shell script using <pre>. I just got around to organising to bulk validate some of my web pages, and one of the problems occurs with Bash shell pieces like this: <pre><code> #!/bin/sh ftp -i -n ftp.server.com&lt; &lt;EOF user username password epsv4 cd /
0
8233
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8170
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8675
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8334
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8474
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5561
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4078
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2604
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1784
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.