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

.js file access in frames

Status
Not open for further replies.

cc4mail

Technical User
Jan 8, 2002
47
US
I have placed all my javascript functions in a .js file for access by a three frame page for easy maintenance.

One frame has no problems accessing the functions, however the other two return an "object expected" error. The coding and functions are correct, and worked worked fine when placed on the originating page.

Is this an issue of placing the src="xx.js" in the frame tag or head of the main frame page, instead of the calling frame page, or simply that the first frame to access the .js file locks out access to the .js file by the other frames.

What have I missed here?

Thanks.

 
If you have included the JS file in a parent or sibling frame, you can simply reference them usign a syntax such as :

parent.myFunction();

to call a function called myFunction defined in a JS file attached in the parent window.
 
Great, I will do it. thanks for your help.

But a question...

I included the src="xx.js" in each of the sibling frames. Any idea why frame[0] could access the .js file but not frame[1] or frame[2]?
 
Not sure, if you can post the code or a link then I can have a look.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top