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!

Do I need to use javascript for this?

Status
Not open for further replies.

subtvshow

Technical User
Jul 14, 2002
21
US
I would like to call other pages onto my main page
using a pop up menu that has tags that look like
this: (i have the pop up menu working but cant link
the onclick event to changing the SSI in the layer.

linkset[0]='<div class=&quot;menuitems&quot;><a href=&quot; button text</a></div>'

I have tried an iframe, but it causes problems. So I am
tryingto use SSI, or ASP to include the htm page
inside my parent page so that I can avoid the function
problem that I am having. How do I change the htmls
inside of my layer from the above button? The layer looks
like this:

<div id=&quot;Layer2&quot; style=&quot;position:absolute; left:643px; top:235px; width:137px; height:107px; z-index:102&quot;></div>
 
what kind of problems with the iframe are you having?
======================================

if (!succeed) try();
-jeff
 
well there is a button in the iframe that needs to
activate a function in the parent page. When using
an iframe, I cannot get the parent function to
work. It supposed to send a variable to my
mediaplayer element in the parent page.
How can I do that? I tried solving that problem and
noone could help me with that one either.
can you?
 
you should be able to access the parent frame's function using this syntax:

parent.frames[frameName].functionName(args);

for instance, if you've defined a function foo() in your main document, from the iframe you can call it:

parent.frames[0].foo();

hope this helps. ======================================

if (!succeed) try();
-jeff
 
here is the function that is in the inframe, and needs it
needs to activate the media player in the parent page.
I get &quot;object expected&quot; error. I included the parent.frames
line. what now?

parent.frames[0].setBandwidth (connectionSpeed) {
if ((navigator.userAgent.indexOf(&quot;IE&quot;) > -1) && (navigator.platform == &quot;Win32&quot;)) {
MediaPlayer.autoStart = true;
MediaPlayer.Filename = connectionSpeed + '.asx';
} else {
document.MediaPlayer.SetAutoStart(true);
document.MediaPlayer.SetFileName(connectionSpeed + '.asx');
 
if you're defining this function in the page that the iframe loads, then i think it should look more like this:
Code:
function setBandwidth (connectionSpeed) { 
	if ((navigator.userAgent.indexOf(&quot;IE&quot;) > -1) && (navigator.platform == &quot;Win32&quot;)) {
		parent.frames[0].MediaPlayer.autoStart = true; 
		parent.frames[0].MediaPlayer.Filename = connectionSpeed + '.asx';
	} else {
		parent.frames[0].document.MediaPlayer.SetAutoStart(true);
		parent.frames[0].document.MediaPlayer.SetFileName(connectionSpeed + '.asx');
	}
}


are the SetAutoStart() and SetFileName() functions built-in to the mediaplayer, or did you make those?

=============================================================== ======================================

if (!succeed) try();
-jeff
 
I had to do some adjusting, but the idea was correct.
Thanks again for your response!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top