How to create .inc file

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have few lines that I am using a lot in different pages...
such as

if ((document.FrontPage_Form1.Name.value) == "a")
{ document.FrontPage_Form1.Name.value="......"
}

else if ((document.FrontPage_Form1.Name.value) == "b"
{ document.FrontPage_Form1.Name.value="...."
}

something like that...how can i include that in .inc file, and how would i
call that .inc file?

Any help will be greatly appreciated....Thanks :)
 
You would create external .js file since you are working with JavaScript

--
==============================================
Thomas A. Rowe
Microsoft MVP - FrontPage
==============================================
Agents Real Estate Listing Network
http://www.NReal.com
==============================================
 
Syntax for external JavaScript (WARNING! - Not a real URL!):

<script type="text/javascript" src="../whatever.js"></script>

--
HTH,

Kevin Spencer
Microsoft MVP
Software Composer

A watched clock never boils.
 
By which I mean, save it (File > Save) and give it a name, with the *.inc
file extension.
 
Thank you so much for all your help. When i use .inc file, i find that the
code in .inc file gets included in view source...I want that code not to be
visible to anyone...any possible way of doing it...would that be possible if
I use javascript
 
You can't hide the code.

To run it with javascript is to download it first. (Download, then run)

So anybody that wants the code, can get it.

ASP is different as it is run on the server, you will have to switch your
app to ASP or similar to avoid the download the code issue.

Or, just relax about it. Most people all worried about their code really
don't have much to hide.
 
Back
Top