Forums

This topic is locked

Server-side Includes vs. JavaScript Includes

Posted 18 Jul 2003 16:02:30
1
has voted
18 Jul 2003 16:02:30 Katherine Williams posted:
I was wondering if one was better than the other when it comes to using JavaScript scripts in SSI's vs. JS inside of <SCRIPT> tags.

Examples:
1)SSI: <!--#include virtual ="/css.asp" -->
The "css.asp" include file has a script located inside of a <script language="JavaScript">

2) JS: <script language="JavaScript" src="rbvalidation.js"></script>
The "rbvalidation.js" page has a script without the <script language="JavaScript"> tag, because the tag's actually located on the webpage itself.

I would like to have everything universal on my site, so I want to work with what's the proper way to do things. Any help would be appreciated. Thanks.

KWilliams

Replies

Replied 18 Jul 2003 16:52:28
18 Jul 2003 16:52:28 Lee Diggins replied:
Hi

There is a difference between the two which is major.

The include file is added by the server and processed by the server, then creates the output html/asp etc file and sends it to your browser - server side processing finished - the end!

The js file, as you describe, allows you to run javascript functions etc on the <b>client</b> without including the javascript functions code in the page that is being displayed in the browser. This helps keeps the page size down.

So, as you can see, they provide different levels of functionality, a bit like comparing oranges and apples.

Digga

Sharing Knowledge Saves Valuable Time!!!
Replied 18 Jul 2003 16:58:59
18 Jul 2003 16:58:59 Katherine Williams replied:
Gosh, thanks for the quick response<img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle> I had a feeling that what you described was true, but I couldn't get my mind around it for some reason. I'm somewhat of a newbie when it comes to SSI's. Thanks for your input Digga the Wolf<img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle> I GREATLY appreciate it. have a great weekend!

KWilliams

Reply to this topic