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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

what can go into an include page 1

Status
Not open for further replies.

optjco

IS-IT--Management
Apr 13, 2004
185
GB
I am starting to look at includes to use in my pages on our intranet and i was wondering whether it is possible to use different types of code in a single page such as

vbscript functions
javascript functions
CSS

etc.

Regards

Olly
 
Thanks for the speedy reply Chris,Does it have to be set up a specific way or can I say put all my css first, then vbscript and last javascript

Regards

Olly
 
Nope
It's simply set out as any other page just in seperate sections.

so if you have a common functions include that could go at the top. an include with javascript in could be there, the style sheet could be an include as well though these are better as external files and linked in.

so wherever a section would be normally be in the page you simply replace that code with the <!--#include file|virtual ="filename"--> directive. With filename pointing to the appropriate file of course [lol]



Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
Nightclub counting systems

So long, and thanks for all the fish.
 
Chris,
thanks for that, it has helped me understand better the use of includes. I will start trying it tomorrow although i am sure I will be re-visiting this post for more info if need be

Regards

Olly
 
Sorry Chris, just one more question, If I say add all of the functions I use for a particular subject on our intranet(which may contains up to 20 pages) into one include page even though some of the pages may only use one of the functions, will this slow down the refreshing of pages ?

Regards

Olly
 
not by any noticeable margin. only functions that are actually operating take CPU time up. It will take up some memory to store the fuction names though.

Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
Nightclub counting systems

So long, and thanks for all the fish.
 
OK,thanks that should not be a problem the server that our Intranet is on has 1GB memory. I am thinking along the lines of having one include for all my vbscript functions and one for all my javascript functions, and then doing as you suggested with the CSS by linking them.

Regards

Olly
 
that should work ok. I go even further than that and split the functions into related groups.
so file, text, SQL, maths, navigation function all have their own include file. constants and variables have seperate includes as well.
This means I can easily find any particular function rather than wading though one file with hundreds of functions in it.
Then I have a include file that is a list of include so if I add a new group or split them up further, there is only one file to edit. option explicit is the first line of this file so it doesn't get missed.
Like so.
I even go as far as having an include that includes the CSS file so I could rename or move (or split into several) the style sheet and I still only edit one file rather than hundreds.
This approach comes from working on an intranet where if it wasn't done an hour ago it was too late. [lol] and I could say "That will take a couple of hours" knowing it would take 10 mins and earn myself some peace and quiet.



Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
Nightclub counting systems

So long, and thanks for all the fish.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top