View Full Version : Having one js file call another js file?
10-22-2005, 12:11 AM
I just now learning how to create and use js files.
I was wondering if you can have one js file have a call to another js file in it.
I tried putting this as the the last line of a js file:
I know you are normally suppose to leave off the <script></script> tags in the js file, but I thought I would try it anyway. Of course it didn't work, so if you can call another js file from with in the js file, how do you do it.
you can document.write one file from another
which happens immediately
Or you can bring a file in when needed
10-22-2005, 01:14 AM
Or you can take the actual code from the thumbnail file and paste it into the bottom of the other include file.
10-22-2005, 02:22 AM
Your first example is just what I was looking for. I will add the second one to my list of tips I'm saving in a word.doc for reference.
The first js file contains the variables and functions that are unique to that page. The second js file is for functions that will be used for all my tumbnail pages.
The reason I want to have a js file for the variables and functions that are unique to each page is because I'm planning on finding away to use the same tumbnail page over and over again instead of creating 50 different tumbnail pages. I'm doing research on that problem right now.
BTW I just publish the website that I have been working on:
If you want to see the tumbnail page that I have been working on, just choose the "Catalog of Pictures" from the menu on the left.
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.