SourceTec Software

It is currently Thu Apr 24, 2014 4:11 am

All times are UTC + 8 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Thu Jul 18, 2013 7:46 pm 
Offline
Member

Joined: Thu Jul 18, 2013 7:25 pm
Posts: 2
I have a DHTML menu set up and working across frames. The menu resides in "middleFrame" but it is projected into the "mainFrame". So it appears the menu actually creates itself in the mainFrame area. I am trying to initiate a javascript function that resides in the middleFrame from the button click.

for instance in the button Link area I have:

javascript:parent.frames[frameMiddle].testFunction()

This doesn't work. It gives the error "Object doesn't support this property or method"

I have tried several different ways of calling functions across frames..


such as:
javascript:parent.testFunction()
javascript:parent.frameMessages.testFunction()
javascript:parent.frames[frameMiddle].testFunction()
javascript:window.parent.frames[frameMiddle].testFunction()

nothing seems to work.

The only way i've found to make it work is to place my function directly on the page that is loaded in the frameMain frame or include a .js on the page loaded in frameMain. But i don't want to do this as the pages in frameMain are constantly updating/changing.

Is there any way to do this?


Top
 Profile  
 
PostPosted: Thu Jul 18, 2013 11:28 pm 
Offline
Guru
User avatar

Joined: Mon May 10, 2004 3:53 am
Posts: 1752
Location: Rescue, CA, USA
I believe the frameset and frame elements are obsolete in HTML5, and I doubt that any of us on this forum will be able to answer your question. I suggest that you write to support@sothink.com and ask Tech Support for help.

Regards,

Bill
Unofficial DHTML Menu Resource Site


Top
 Profile  
 
PostPosted: Fri Jul 19, 2013 11:01 pm 
Offline
Member

Joined: Thu Jul 18, 2013 7:25 pm
Posts: 2
I figured it out.

You just use a standard js call in the "link" field and the name of the frame in the "target" field. I guess the menu software is smart enough to tell the difference between a url and js link and writes the output accordingly. You dont use "parent." as you normally would.


Top
 Profile  
 
PostPosted: Sat Jul 20, 2013 12:04 am 
Offline
Guru
User avatar

Joined: Mon May 10, 2004 3:53 am
Posts: 1752
Location: Rescue, CA, USA
Thanks for posting the solution. It will be helpful to anyone else who wants to use JavaScript across frames.

Regards,

Bill
Unofficial DHTML Menu Resource Site


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 8 hours


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group