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

How to call a function from a different frame?

Status
Not open for further replies.

CWebster

Programmer
Jun 12, 2002
38
GB
I've got several domains that all share one common page via the use of frames. This common page needs to use a function defined in the navbar frame. The name of the navbar frame will always be the same.

Bearing in mind that I therefore cannot specify a URL, how can this be done?

 
can you use a javascript include file and place the function in that?
Tony
reddot.gif WIDTH=300 HEIGHT=2 VSPACE=3

 
I don't know anything about JavaScript incluse files - are they like SSI include? If so, I thought that you had to reference the file absolutely, but in this case I need to reference it only by frame name
 
Does your common page use the same function for each site or is it just the name of the function that is the same?

I dont think you can reference a javascript function from a frame but you could have an include file with all your common javascript functions in that all your sites could use. An absolute address for this include file should not then be a problem. Use as follows

Code:
<HTML>
<HEAD>
<TITLE>page title</TITLE>

<SCRIPT LANGUAGE=&quot;JAVASCRIPT&quot; SRC=&quot;[URL unfurl="true"]http://www.yoursite.com/js/functions.js&quot;></SCRIPT>[/URL]
</HEAD>
<BODY>
etc....
Tony
reddot.gif WIDTH=300 HEIGHT=2 VSPACE=3

 
The common page will actually be calling a CSS file, and this file needs to be different for every domain that calls it.

I've been fiddling around for a while, trying to find a way to call the function from the navbar frame without any success :(

Looks like I'm going to have to find another way....

Thanks for your help though, it's been much appreciated!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top