On my website I have a javascript, but this is on everypage and if i want to add something to it i have to update each page. How do I use '.js' or '.class' files within a html document, if this is what im needing.
: On my website I have a javascript, but this is on everypage and if i want to add something to it i have to update each page. How do I use '.js' or '.class' files within a html document, if this is what im needing. : : Thanx :
All you need to do is place the script in a source file and call it myScript.js or whatever name you like. Assuming you place this at your root and the pages that you wish to use it in are also at the root, place the following tag between the openning and closing tag of every page you wish to use the script in:
Of course, you would need to replace myScript.js with whatever name you gave it.
If your html page is somewhere other than where the script source resides, then you need to put the relative path along with the source file name in the src attribute of the tag, the same way you would refer to an image or a document that resides in a folder other than that of the page you are making the link in.
Happy Computing, Arash Sayadi 15530-B Rockfield Blvd. Suite 4 Irvine, CA 92618 949-830-1623 x36 949-830-2120 Fax www.pts1.com [email protected]
All you do is include the following text at the top of each page:
The "functions.js" file has all the functions you want to use in multiple pages. To include a file outsite of your website root directory use this:
Your functions.js file would then look something like this:
Hope this helps - Xapis
: On my website I have a javascript, but this is on everypage and if i want to add something to it i have to update each page. How do I use '.js' or '.class' files within a html document, if this is what im needing. : : Thanx :
between the tags. Now i want the function to be called in the page, how do i do this? the function is called 'image()'. sorry but im new to javascripting
: All you do is include the following text at the top of each page: : : : : The "functions.js" file has all the functions you want to use in multiple pages. To include a file outsite of your website root directory use this: : : : : : Your functions.js file would then look something like this: : : : : : : : Hope this helps : - Xapis : : : : On my website I have a javascript, but this is on everypage and if i want to add something to it i have to update each page. How do I use '.js' or '.class' files within a html document, if this is what im needing. : : : : Thanx : : : :
: I have added : : between the tags. Now i want the function to be called in the page, how do i do this? : the function is called 'image()'. sorry but im new to javascripting : : : All you do is include the following text at the top of each page: : : : : : : : : The "functions.js" file has all the functions you want to use in multiple pages. To include a file outsite of your website root directory use this: : : : : : : : : : : Your functions.js file would then look something like this: : : : : : : : : : : : : : : Hope this helps : : - Xapis : : : : : : : On my website I have a javascript, but this is on everypage and if i want to add something to it i have to update each page. How do I use '.js' or '.class' files within a html document, if this is what im needing. : : : : : : Thanx : : : : : : : : :
Comments
:
: Thanx
:
All you need to do is place the script in a source file and call it myScript.js or whatever name you like. Assuming you place this at your root and the pages that you wish to use it in are also at the root, place the following tag between the openning and closing tag of every page you wish to use the script in:
Of course, you would need to replace myScript.js with whatever name you gave it.
If your html page is somewhere other than where the script source resides, then you need to put the relative path along with the source file name in the src attribute of the tag, the same way you would refer to an image or a document that resides in a folder other than that of the page you are making the link in.
Happy Computing,
Arash Sayadi
15530-B Rockfield Blvd. Suite 4
Irvine, CA 92618
949-830-1623 x36
949-830-2120 Fax
www.pts1.com
[email protected]
The "functions.js" file has all the functions you want to use in multiple pages. To include a file outsite of your website root directory use this:
Your functions.js file would then look something like this:
Hope this helps
- Xapis
: On my website I have a javascript, but this is on everypage and if i want to add something to it i have to update each page. How do I use '.js' or '.class' files within a html document, if this is what im needing.
:
: Thanx
:
between the tags. Now i want the function to be called in the page, how do i do this?
the function is called 'image()'. sorry but im new to javascripting
: All you do is include the following text at the top of each page:
:
:
:
: The "functions.js" file has all the functions you want to use in multiple pages. To include a file outsite of your website root directory use this:
:
:
:
:
: Your functions.js file would then look something like this:
:
:
:
:
:
:
: Hope this helps
: - Xapis
:
:
: : On my website I have a javascript, but this is on everypage and if i want to add something to it i have to update each page. How do I use '.js' or '.class' files within a html document, if this is what im needing.
: :
: : Thanx
: :
:
:
: I have added
:
: between the tags. Now i want the function to be called in the page, how do i do this?
: the function is called 'image()'. sorry but im new to javascripting
:
: : All you do is include the following text at the top of each page:
: :
: :
: :
: : The "functions.js" file has all the functions you want to use in multiple pages. To include a file outsite of your website root directory use this:
: :
: :
: :
: :
: : Your functions.js file would then look something like this:
: :
: :
: :
: :
: :
: :
: : Hope this helps
: : - Xapis
: :
: :
: : : On my website I have a javascript, but this is on everypage and if i want to add something to it i have to update each page. How do I use '.js' or '.class' files within a html document, if this is what im needing.
: : :
: : : Thanx
: : :
: :
: :
:
: