Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

crtd site usng js to bld pg acrdg to app.name & s.width...- qck ?...

Status
Not open for further replies.

spewn

Programmer
May 7, 2001
1,034

i have created a site and decided to use an external j/s page to control and create most of the html page. Where there should be a <table>, for instance, there is a j/s call to a function that dependent on the brand of browser and screen size, 'document.write' is used to customize that particular <table>'s width and other features. no biggie, but the entire site has become a call to specific functions, from tables and nav bars to img's. i know you can accomplish this with other languages, but right now, j/s is my learning block. a sample of the page looks like this:


********************

////// this creates main table

<script language=javascript type=&quot;text/javascript&quot;>

otlntbl();

</script>

<tr>
<td align=center valign=top>

////// etc...
*********************


with the external j/s file called in the head, it has this (sample)...


*********************
function otlntbl(){

if (nsmn) mytable('center','middle','null','540','0','0','0','hdr');
if (nsrg) mytable('center','middle','null','620','0','0','0','hdr');
if (nsmx) mytable();

if (otmn) mytable('center','middle','null','540','0','0','0','hdr');
if (otrg) mytable('center','middle','null','620','0','0','0','hdr');
if (otmx) mytable('center','middle','null','700','0','0','0','hdr');

}

////// etc...(it works well, all the variables are named in the full script)
*********************

this is good so when there is an update, i can only change one page to effect the whole site.

Question!!!

will the page being written on the fly using extensive j/s functions slow down the site? i'm using it to control everything just about, to preserve continuity...it doesn't seem to bog, but thought i might bounce it off the group...

(i value all opinions and appreciate them even more)

thanks! -g

 
I don't see how it COULDN'T slow down the site! However, whether it slows it down enough to make a significant difference it another matter entirely. The only way to know for sure is to try it out and see. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Javascript is one of those things you just can't benchmark. Since it is a client side language, the speed is going to depend entirely on the viewer's system. If you're target audience consists of the techies that are going to have all the latest gadgets, do whatever you like. However, if you expect Joe Oldie with his 486 DX/100, you might consider a reimplementation.

Food for thought.

Tasty,
brendanc@icehouse.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top