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="text/javascript">
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