Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: Forms and Frames.....


Message #1 by tburfine@k... on Tue, 20 Feb 2001 03:31:13
on 20/2/01 5:29 pm, tburfine@k... at tburfine@k... wrote:

> Ok...
> Thats beyond me. Im just starting the "Java Thing"
> How would I create a js file and then load it?
> 
> Thor
> 
> 
>> Use an external js file from which you can call the function from any
> frame.
>> 
>> -----Original Message-----
>> From: tburfine@k... [mailto:tburfine@k...]
>> Sent: Monday, February 19, 2001 11:31 PM
>> To: javascript
>> Subject: [javascript] Forms and Frames.....
>> 
>> 
>> Simple solution I hope???
>> 
>> Have a frame page
>> 
>> pDrivers.htm
>> 
>> It has 2 frames
>> header
>> A page that has 5 Select boxes and 2 buttons inside of a form
>> 
>> In the head section of this page is a function
>> tkbCreateWhere()
>> when I click on the button I get
>> 
>> tkbCreateWhere is not defined
>> 
>> How do I referance this function?
>> 
Just make a txt file with the extension .js - externalscript.js for example.
Then in your .html page within the <head> tags above any javascript code you
place in the page, use:
<script language="Javascript1.2" src="externalscript.js"></script>

This will then pull in all the data from the external .js file - obviously
this example is with the external .js file in the same directory, if it's
not just add the path in the src= param.
In the external file you don't need to put the <script> tags as this is
already done in your .html page. You will need to surround your code with
the <!-- and //--> hiding marks.
Hope this helps
Happy coding :-}
Luke

  Return to Index