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: Archived Topics for the old Version 3.0 JavaScript Menu
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:22

Targeting to Iframe trouble


Poster: Alexxa
Dated: Tuesday August 5 2003 - 20:33:23 BST

It seems so easy to target a link in a version 3 menu to an iframe by adding target=targetname.

Code:
"Stage One","http://ssiups.com/stone.html target=maine"


I certainly did that, and the page did open up in the iframe like i asked, except it said Error in the status bar, and I knew something was wrong.

So I decided to start all over again and go to the famous page that explains how do target a link to an iframe, http://www.milonic.co.uk/menu/menusampl ... ampleid=16, and tried to add that whole javascript thing:

Code:
"Stage One","javascript:openIFrame(\"maine\", \"stone.html\")",,,1


Well, once I added that I added
Code:
function openIFrame(iframeId, winURL){
ifId=gmobj(iFrameId)
ifId.src=winURL
}

to the <head> section of my page stone.html. After I did all that, when I clicked on the link in the menu that said Stage One, nothing opened in my iframe and, once again, I see Error in the status bar.

Is there something I'm doing wrong? Because none of this is working, I need help.


Poster: Hergio
Dated: Wednesday August 6 2003 - 15:10:41 BST

make sure in your iframe declaration, you have the id of the iframe set correctly to "maine". Its very important.
Code:
<iframe id="maine" name="maine" src="" height="100" width="100"></iframe>


Poster: Alexxa
Dated: Friday August 8 2003 - 5:38:08 BST

Yeah I did that, but it STILL gives me the same thing as I said. I STILL get an error in the status bar.


Poster: Hergio
Dated: Friday August 8 2003 - 15:53:10 BST

Duh, this is easier than it looks as I just found out. Put your iframe in your page and make sure its id and name are set. Then in your menu link, put in a target attribute and it will work. I.E
Code:
aI("text=Google;url=http://www.google.com;target=myiframe");

Pretty easy huh? It was staring us right in the face. Give it a try, hope it works for you!


Poster: Hergio
Dated: Friday August 8 2003 - 16:59:25 BST

Man I am really out of it today, this is a second time I have posted a solution for the v5 menu in the v3 forum....i apologize again.
Ok to get to work with v3, use this way of declaring a menu item

Code:
,"Go To Yahoo","http://www.yahoo.com target=myiframe;sourceframe=myiframe; onbordercolor=0000ff;offbordercolor=FFFFFF;",,"Yahoo",0

And just make sure your iframe has an id AND name tag called myiframe. Should work, let me know if it does!


Poster: Alexxa
Dated: Monday August 11 2003 - 3:42:11 BST

Christ this is really pissing me off. Thanks for your code Hergio, but when I tried to put this tag, when I put my cursor over the link in the menu, it gives me an error in the status bar. And where should I put this:

Code:
<script language=javascript>
function openIFrame(iframeId, winURL){
ifId=gmobj(iFrameId)
ifId.src=winURL
}

</script>


Poster: Hergio
Dated: Monday August 11 2003 - 4:28:16 BST

Get rid of that code, it has nothing to do with the menu anymore...you dont need it. Make your iframe in your page have an ID and a NAME that are defined clearly. And then in your menu declaration, right after you type out your URL you put in the

target=myiframe;sourceframe=myiframe;

as you can see i have an iframe in my page like so:
Code:
<iframe src="http://www.google.com" width="500" height="200" id="myiframe" name="myiframe"></iframe>

And I have a menu declaration like so:
Code:
,"Apple in Iframe","http://www.apple.com target=myiframe;sourceframe=myiframe;",,,0

This exactly worked for me.


Poster: Alexxa
Dated: Monday August 11 2003 - 5:16:51 BST

I did that exact thing, and it works, it opens up in the iframe like it's supposed to, but it says in the status bar Error on Page or Done, but with errors on page. As soon as I put my cursor on the link in the menu, the error begins. If you want to see my menu_array.js, it can be found here: http://flirt-with-suicide.net/poison/menu_array.js


Poster: Hergio
Dated: Monday August 11 2003 - 13:10:43 BST

I checked your menu_array file and everything looked good. But then I navigated to your mmenu.js file and I think I found the problem. You are using version 3.3.19 of the old menu, when the most current (and final) version is 3.5.something. I think its erroring because you are using the old version and I was using the new version. Go to the menu homepage, view the source and download the mmenu file, andy will be using the most current on his pages. That should clear up the problem.

BTW, I noticed the URL to your site being kinda fishy. I hope you're not using this menu for things that pertain to the topic described in your URL, because if so, that your choice, but I will not help you any longer.


Poster: Alexxa
Dated: Tuesday August 12 2003 - 3:51:28 BST

I did change my mmenu.js file to the one on the menu homepage, and it FINALLY worked. I want to thank you, Hergio, for helping me through my stupidity, I couldn't have done it without you :D

And to clear things up on my url, if you must know, it came from a Korn lyric that is very meaningful to me and, in no way, promotes suicide. It would really be great if people in this world wouldn't be so narrow-minded and wouldn't take things so litterally, as this url is a mere sarcasm. It's sad that you think you know my story and you think you know where I'm coming from to directly assume that I was promoting suicide. My website could have been a site about helping people with suicide or maybe it doesn't even pertain to suicide but no, you had to take the negative road and threaten to cease helping me with my problems. All in all, the way I use my menu is none of your business and for future reference, open up your mind, it would do you some good.


Poster: fredlongworthhighschool
Dated: Tuesday August 12 2003 - 10:12:27 BST

Your URL is blocked by our company filters, so I can't even see what its about.


Poster: Hergio
Dated: Tuesday August 12 2003 - 12:58:34 BST

Alexxa, I was not trying to insult you because, I agree, I did not know exactly what you're site was about. I even tried to investigate by navigating around it to give you the benefit of the doubt, but found nothing. And I wasn't telling you that I was going to stop helping you now, I was just saying that if it was about helping people to commit suicide, I wouldn't feel right helping someone get a site up and running to help people do that. Now, you don't have to believe anything I say, but I do have an open mind about things, and I try to look at all sides of a story and rarely ever get a temper, and I could have bashed your url for being laden with suicide terms. But didnt, thats that open-mind thing working there. Also, as its probably very evident, I don't listen to Korn so I did not know of the lyric. But if you take the term 'flirt with suicide'...open minded or not, it sounds like someone is flirting with killing themselves, but ok, I guess it could be a site for something else, like as you mentioned, helping someone who is contemplating it to not do it. But then you see a directory called poison...umm that doesn't really lend itself to that 'helping someone' idea. What it actually looks like is a url regarding suicide, but now a directory devoted to the poison aspect of suicide, and people use poison so its not exactly far fetched for me to have thought what I did. Please understand, if the url has nothing to do with helping someone commit suicide, thats great, and thats why I didn't bash you from the start because I was not sure. I told you, it looked "kinda fishy" and that was "your choice", not that you were a anti-life, anti-social, death loving atheist. Because thats what someone with a closed-mind might have done.
Quote:
It's sad that you think you know my story and you think you know where I'm coming from to directly assume that I was promoting suicide
And for the record, no, I dont think I know your story or where you are coming from...I actually never said that nor inferred it. I explained where I was coming from above and hinted to you that if that was your story and that was where you were coming from, then that was your choice (meaning I am not going to bash you or preach to you), and if not, lets move on. What I dont like is people in this world putting words in my mouth and telling me what I am thinking. :x

I'd rather not take this any farther. I would love to continue to help you with your questions and problems pertaining to this menu. Thats the reason we're all here anyways.


Poster: Alexxa
Dated: Wednesday August 13 2003 - 4:45:26 BST

To me, they key thing here is not to take everything so litterally.

Quote:
But then you see a directory called poison...umm that doesn't really lend itself to that 'helping someone' idea. What it actually looks like is a url regarding suicide, but now a directory devoted to the poison aspect of suicide, and people use poison so its not exactly far fetched for me to have thought what I did.


It's actually funny how you even present the idea that having a directory called poison could be some kind of threat, and agian took it litterally. I have a friend whose url is kittenx.com. Does this mean now that we have to be all litteral and assume that her site is about kittens? And I, in no way, put any words in your mouth.

Oh, and for your information Hergio and fredlongworthhighschool, the site that I am using this menu on is not even my flirt-with-suicide.net site, but I guess that idea didn't even pop up in your heads, and you just decided, once again, to assume you know what you're talking about.

People are so funny. Thank you for your time, I appreciated your help.


Poster: fredlongworthhighschool
Dated: Wednesday August 13 2003 - 8:53:21 BST

Alexxa wrote:
If you want to see my menu_array.js, it can be found here: http://flirt-with-suicide.net/poison/menu_array.js


Alexxa wrote:
Oh, and for your information Hergio and fredlongworthhighschool, the site that I am using this menu on is not even my flirt-with-suicide.net site, but I guess that idea didn't even pop up in your heads, and you just decided, once again, to assume you know what you're talking about.



Bit of a contradiction that. If you have your JS files on this URL, then it seems pretty clear that your menu would be there.

I don't have a problem with your URL so I don't know why you're having a go at me (BTW my name is Andy if you'd looked at the end of my posts), I was just pointing out that the filters on our school web system prevent me from even looking at your site so I cannot help or even make an opinion of the content.

And looking at my last post, I didn't even make any comment. By all means have a go at me if I have made any false assumptions. But I haven't.


Poster: Alexxa
Dated: Tuesday August 19 2003 - 4:56:04 BST

Quote:
Bit of a contradiction that. If you have your JS files on this URL, then it seems pretty clear that your menu would be there.


Wow, just because I have that file up there makes you absolutely certain that I'm using it on this site? Well, you couldn't even THINK for one second to wonder that I was just testing this file out. And I don't have to explain myself to you. I know where I'm putting my *----*.


Poster: fredlongworthhighschool
Dated: Tuesday August 19 2003 - 9:48:59 BST

That still doesn't explain or excuse the attitude you've taken to the people who have tried to help you, one of which didn't even comment on the nature of your site from the very beginning.


Poster: Hergio
Dated: Tuesday August 19 2003 - 13:19:54 BST

Alright alright, this is ridiculous. Alexxa, nobody was trying to insult you. You have to understand that when someone looks at something, they can't always say, 'well maybe this isn't the real story'. 90% of the time in life you have to (at least to start) take things at face value. Thats all you have to go on. If I went around my whole life saying, 'well maybe this isn't exactly what it looks like', I would drive myself crazy. Understand people will make mistakes, and assumptions; its human nature. But there are alot worse (and mean) assumptions one can make than saying, hey you might be using the menu on this url because you're posting to it. If you'll notice the people on here are to help you, so we'd appreciate alittle respect. If we insulted you, we apologize, but it wasn't intentional. If you want to go around and bite the heads off of people who accidently step on your toes, then I'm sorry, but you're not going to go very far. Best of luck with the menu, whatever you are going to use it for (note: no assumptions here).


Poster: Alexxa
Dated: Wednesday August 20 2003 - 7:01:46 BST

I am very happy with the menu and I appreciate all of your help.

Oh, and one more thing, I'm not human.