Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:49

IFRAME question


Poster: mjordan
Dated: Monday January 5 2004 - 7:08:16 GMT

Hi Have some JS

with(milonic=new menuname("Links")){
style=menuStyle;
aI("text=NEW Apache;url=http://www.apache.org;target=_new");
aI("text=iframe Apache;url=javascript:openIFrame('tempiframe','http://www.apache.org/')");
aI("text=iframe myfile;url=javascript:openIFrame('tempiframe','me.htm')");
aI("text=myfile;url=me.htm;target=tempiframe");
}

which plays around with IFRAME as in the sample
http://www.milonic.com/menusample.php?sampleid=11

the first one loads a new window...thats cool
the second one opens it in the iframe...thats cool
the third opens me.htm in the iframe...that cool
the fourth one opens a new window which I not sure why given that the target is the name of the IFRAME "tempiframe")

Any help would be appreciated. I have searched thru the forum already..

Regards
Mick

Re: IFRAME question


Poster: fredlongworthhighschool
Dated: Monday January 5 2004 - 9:15:04 GMT

mjordan wrote:
Hi Have some JS

with(milonic=new menuname("Links")){
style=menuStyle;
aI("text=NEW Apache;url=http://www.apache.org;target=_new");
aI("text=iframe Apache;url=javascript:openIFrame('tempiframe','http://www.apache.org/')");
aI("text=iframe myfile;url=javascript:openIFrame('tempiframe','me.htm')");
aI("text=myfile;url=me.htm;target=tempiframe");
}


Is it because your last link doesn't have url=javascript:openIFrame in it?


Poster: mjordan
Dated: Monday January 5 2004 - 23:07:43 GMT

Thanx Andy,

Just thought I could target the Iframe directly...obvioulsy not...thanx for you assistance

BTW...I use Frontpage to do my design and have noticed that the third menu
aI("text=iframe myfile;url=javascript:openIFrame('tempiframe','me.htm')");
doesnt display the contents of the iFrame when I select the menu item in "Preview"...i.e. I have to load the page into a browser before it will work

Thanx
Mick


Poster: fredlongworthhighschool
Dated: Tuesday January 6 2004 - 8:11:59 GMT

It's funny, I also use Iframes but I don't use the method you do. A typical link of mine is as follows:

Code:
aI("text=July 2003;url=news/newsletter_july.htm;status=News for July 2003;target=fred")


Poster: John
Dated: Tuesday January 6 2004 - 14:04:35 GMT

Watch out for Frontpage, Mick. It's famous (or perhaps, infamous) for changing code behind your back. We've had users here reporting problems with it. Double-check your code (even more than usual!).


Poster: mjordan
Dated: Wednesday January 7 2004 - 5:39:30 GMT

Thanx John (another "quality" M$ product) ;-)

Andy, I did check your code before I posted and it looked like my example 4
aI("text=myfile;url=me.htm;target=tempiframe");
was the same as yours so I couldn't understand why mine was loading a new frame

Cheers
Mick


Poster: Hergio
Dated: Saturday January 10 2004 - 5:54:52 GMT

You gotta have a frame or iframe somewhere on the page (or even another window) with its ID set to whatever you specify in the target. When the link is called upon, it will take the target and look for a frame, iframe, or open IE window with that ID, and load the URL in that. If it cannot find a match, it will open a new window and assign the window whatever was specified in the target. Hope that helps.