Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
| Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old August 26th, 2005, 03:30 PM
Authorized User
Join Date: Aug 2005
Location: , , .
Posts: 64
Thanks: 0
Thanked 0 Times in 0 Posts
Default function calling from another frame

oopsss ... stucked 2nd time ... i know i'm just good 4 nothing in front of all the members of this forum ... but still i jave a hope that some day i'll learn
now the problem izzzzzz
i've created a page having 3 frames named as topFrame, midFrame, botFrame
now i've defined some functions in all these frames
when i want 2 call a function from botFrame that is defined in topFrame then i write window.top.topFrame.func1() ... it works pretty good
but the same when i call a function from topFrame or midFrame that is defined in botFrame then i write window.bottom.botFrame.func2() ... but this doesn't work ... i dont know Y ... can anybody help me

w8ing 4 a good reply

  #2 (permalink)  
Old August 27th, 2005, 03:51 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts

window.top refers to either the first declared frame if in a framset or the only window if not. There is no such thing as window.bottom. So if you always use the syntax:
window.top.<name of frame>.<name of function>();
you should be fine. I believe that is valid on all browsers, if not then an alternative is:
window.top.frames["<name of frame>"].<name of function>();

Joe (Microsoft MVP - XML)

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling JS Function from VS? Ron Howerton Javascript 15 September 17th, 2008 02:35 PM
Calling a javascript function from C# SebFr C# 0 November 3rd, 2006 12:05 PM
Javascript function remote frame Dj Kat Javascript How-To 2 January 6th, 2006 12:22 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.