473,399 Members | 3,038 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Is it inefficient to intermix HTML and script?

I've noticed that most examples offered in this group tend to use Response.Write to spit out the HTML rather than switch between
script and HTML. I also came across an article intimating the same idea. Is this considered inefficient?

<%If (IsArray(ar)) Then
Const cNumber = 0
Const cHorse = 1
Const cOwner = 2
Const cTrainer = 3
Const cRider = 4
Const cHorseID = 5
Const cOwnerID = 6
Const cTrainerID = 7
Const cRiderID = 8%>
<tr>
<th width="8%" align="center"><a class="results" href="showshowentries.asp?Show=<%= strShowID%>&Sort=Number"><font face="Arial, Helvetica, sans-serif" size="2"><b>Number</b></font></a></th>
<th width="23%" align="left"><a class="results" href="showshowentries.asp?Show=<%= strShowID%>&Sort=Horse"><font face="Arial, Helvetica, sans-serif" size="2"><b>Horse</b></font></a></th>
<th width="23%" align="left"><a class="results" href="showshowentries.asp?Show=<%= strShowID%>&Sort=Owner"><font face="Arial, Helvetica, sans-serif" size="2"><b>Owner</b></font></a></th>
<th width="23%" align="left"><a class="results" href="showshowentries.asp?Show=<%= strShowID%>&Sort=Trainer"><font face="Arial, Helvetica, sans-serif" size="2"><b>Trainer</b></font></a></th>
<th width="23%" align="left"><a class="results" href="showshowentries.asp?Show=<%= strShowID%>&Sort=Rider"><font face="Arial, Helvetica, sans-serif"
size="2"><b>Rider</b></font></a></th></tr>
<% Dim iRow
For iRow = 0 To UBound(ar,2)%>
<tr>
<td width="8%" align="center" valign="top"><font face="Arial, Helvetica, sans-serif" size="2"><%= ar(cNumber,iRow)%></font></td>
<td width="23%" align="left" valign="top"><a class="results" href="showexhibitorresults.asp?Show=<%= strShowID%>&HorseID=<%= ar(cHorseID,iRow)%>"><font face="Arial, Helvetica, sans-serif"
size="2"><%= ar(cHorse,iRow)%></font></a></td>
<td width="23%" align="left" valign="top"><a class="results" href="showexhibitorresults.asp?Show=<%= strShowID%>&OwnerID=<%= ar(cOwnerID,iRow)%>"><font face="Arial, Helvetica, sans-serif"
size="2"><%= ar(cOwner,iRow)%></font></a></td>
<td width="23%" align="left" valign="top"><a class="results" href="showexhibitorresults.asp?Show=<%= strShowID%>&TrainerID=<%= ar(cTrainerID,iRow)%>"><font face="Arial, Helvetica,
sans-serif" size="2"><%= ar(cTrainer,iRow)%></font></a></td>
<td width="23%" align="left" valign="top"><a class="results" href="showexhibitorresults.asp?Show=<%= strShowID%>&RiderID=<%= ar(cRiderID,iRow)%>"><font face="Arial, Helvetica, sans-serif"
size="2"><%= ar(cRider,iRow)%></font></a></td></tr>
<% Next%>
<tr>
<td align="right" colspan="5"><font face="Arial, Helvetica, sans-serif" size="2"><b><%= intTotalEntries%> total show entries&nbsp;&nbsp;&nbsp;&nbsp;</b></font></td></tr>
<%Else%>
<tr>
<td colspan="5" align="center"><font face="Arial, Helvetica, sans-serif" size="2"><b>There are no items to show in this view.</b></font></td></tr>
<%End If%>
</table>
</td>
</tr>
<!--#include file="inc/table_end.asp" -->

Jul 19 '05 #1
4 1468
> I've noticed that most examples offered in this group tend to use
Response.Write to spit out the HTML rather than switch between
script and HTML. I also came across an article intimating the same idea.

Is this considered inefficient?

No, just much more difficult to read / maintain, IMHO. I prefer
response.write, but there really is no difference in performance due to
context switches between ASP and HTML (though at one point the ASP parser
wasn't as smart as it is now, and you would notice a hit given enough
volume).
Jul 19 '05 #2
If you're running IIS 5 or higher, don't worry about it. Do whichever you
are more comfortable with. If you're on IIS 4 (NT), yeah, it's inefficient,
but hopefully you won't be on an NT server for much longer, so I wouldn't
worry about it. Just code comfortably. :]

Ray at work

"Stefan Berglund" <ke****@in.thegroups> wrote in message
news:v9********************************@4ax.com...
I've noticed that most examples offered in this group tend to use Response.Write to spit out the HTML rather than switch between script and HTML. I also came across an article intimating the same idea.

Is this considered inefficient?
Jul 19 '05 #3
On Mon, 20 Oct 2003 13:17:02 -0700, Stefan Berglund
<ke****@in.thegroups> wrote:
I've noticed that most examples offered in this group tend to use Response.Write to spit out the HTML rather than switch between
script and HTML. I also came across an article intimating the same idea. Is this considered inefficient?


For me it's force of habit and the method of coding. I tend to write
ASP in commented pseudocode to get the process down, then fill in the
bits and pieces testing as I go. Since I tend to do a lot of
Response.Write statements to show the output and values as I code,
when I get to the HTML I tend to leave the Response.Write alone and
fit in the HTML code into the Response.Write statements.

On the other hand, when I'm editing/maintaining someone else's code
that has the HTML separated and does things like:

<P>Glad to see you here on <% =(Now) %></P>

Then I tend to work in the same manner the original code is written.

Note that I am by far a sloppy coder, generally poorly organized and
bad at useful documentation, plus I tend to leave irrelevant code in
at times, but hey, it works. :)

Jeff
Jul 19 '05 #4
On Mon, 20 Oct 2003 13:17:02 -0700, Stefan Berglund
<ke****@in.thegroups> wrote:
in <v9********************************@4ax.com>
I've noticed that most examples offered in this group tend to use Response.Write to spit out the HTML rather than switch between
script and HTML. I also came across an article intimating the same idea. Is this considered inefficient?


Thank you gentlemen one and all for your valued consideration and
comments.
Jul 19 '05 #5

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

Similar topics

9
by: ihatzi | last post by:
Hey all! I am having a bit of trouble getting this to work. You all are probably familiar with the code that strips HTML tags: $PageText = preg_replace("/<.+?>/","",$WebPage); What I need...
4
by: VK | last post by:
09/30/03 Phil Powell posted his "Radio buttons do not appear checked" question. This question led to a long discussion about the naming rules applying to variables, objects, methods and properties...
10
by: Andrew Poulos | last post by:
While this works on IE 6: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>aiff</title> <meta http-equiv="Content-Type"...
19
by: thisis | last post by:
Hi All, i have this.asp page: <script type="text/vbscript"> Function myFunc(val1ok, val2ok) ' do something ok myFunc = " return something ok" End Function </script>
12
by: Peter Michaux | last post by:
Hi, I am experimenting with some of the Ruby on Rails JavaScript generators and see something I haven't before. Maybe it is worthwhile? In the page below the script is enclosed in //<!]> ...
10
by: paulie | last post by:
Hi, I have been experiencing an issue when trying to use AJAX to reload a DIV area using a timer of 2000ms, which contains a html page with another DIV and javascript. Scenario -------------...
7
by: imtmub | last post by:
I have a page, Head tag Contains many Scripts and style sheet for Menu and Page. This code working fine and displaying menus and page as i wanted. Check this page for reference....
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
5
by: jeddiki | last post by:
Hello, I have been writing procedural php for a couple of years and I have quite lot of little scrips that I use in different large scripts. I'll give and example I display the category...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.