Click to See Complete Forum and Search --> : include files
pelegk1
04-28-2003, 02:01 AM
i want to know if i am using include files
can the include file say : can use variables that in my vbscript code and do cacluatons for me and return an answer?
if yes then how?where can i read/see examples?
thanks in advance
peleg
khalidali63
04-28-2003, 07:04 AM
Originally posted by pelegk1
i want to know if i am using include files
can the include file say : can use variables that ....
Javascript include files are javascript source code just as it was embedded in the page within the <script> tags.
They can have variables,function dynamic HTML and you name it..
A simplest example is here..this is how you will include a jas file
<script type="text/javascript" src="sample.js"></script>
This is the code that sample.js consists of.
var testVariable="javascript is the coolest";
function testFunction(){
alert(testVariable);
}
Now in the above snippet, you see that a variable contains a simple statement,and then the function just displays the variable value in an alert box.
in the html page you always follow the logical flow of the code,
1. first import or include statement as above
2. and then you can call any variable in the file or use the functions,Assuming, now you have include statement in the page's head section,all the code in the js file is in scope so we can use it.
<script type="text/javascript">
//display variable
alert(testVariable);
//or call the function
testFunction();
</script>
I hope this helps
khaki
04-28-2003, 08:33 AM
Hi Peleg...
you asked about vbscript... so you are obviously looking to use ASP Includes.
<!-- #include file="yourVBScript.inc" -->
Go to google.com
Type : "asp includes"
you will get plenty of resources on this, which should give you a good overview.
reply back if you have any specific questions relating to this.
;) k