openNewWindow code still needed with V5??

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

openNewWindow code still needed with V5??

Post by Ruth »

Do we still need to put

Code: Select all

<script language=javascript>
function openNewWindow(winURL,winWidth,winHeight,winConfig)
{
	mmConfig=""
	mmConfig="width="+winWidth+","
	mmConfig+="height="+winHeight+","
	mmConfig+=winConfig
	var mmWin=open(winURL,"",mmConfig);
	mmWin.focus();
}

</script> 

on all the pages? If not I'd love to get rid of it, I've got so many scirpts being able to eliminate any would be loverly.


Ruth
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

When was it ever said that code was needed on all pages? It's not part of the standard system.
John
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

well, I believe it was with version 3 and I'm pretty sure it was Andy that put it up. I think it was in one of the samples but they are not available to check anymore. I think it was the one with the new windows, different sized windows and iframes. I remember it had Google on it and it was version 3, I remember it was one of the first I tried. But I take it I can get rid of that code in the body section of my pages?


Ruth
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

If you want to open a customizable window on each page then I suppose the code would be necessary on each page. But if not, it may have been a waste of time and effort.

However, you'll be pleased to know that it IS embeded now into version 5.0

There is a new property called targetfeatures, here's a snippet

Code: Select all

aI("text=Open Google;url=http://www.google.com;target=windowname;targetfeatures=width=300 height=300");
More info is at http://milonic.com/menusample.php?sampleid=11

-- Andy
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Thanks Andy. If it's in the new menu then I don't need that code anymore. One question... my knowledge of things is kind of hit or miss about html etc. When you have that target=windowname I take it you windowname to blank or new or parent etc? How would you do the equivalent of this:

Code: Select all

<A href="#" onClick="window.open ('http://www.poems2u.com/borders/abstract/abstract001q.htm',
'javascript_1','height=600,width=350,location,menubar,
resizable=yes'); return false;">etc.

so that it would open a different window each time? Also, let's say you click a link from page 1 which opens a new window page 2 and on that is a link, how would you get that link to open back in page 1? Thanks

Ruth
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

the windowname that andy is referring to is the name that is given to the window that is opened. If you specify target to equal _blank, that will open up an entirely new window every time. Give it a name otherwise.

And in the child window, if you have a link and you want to have it update the parent (or opener) window, use this little piece of javascript. Include it into your page and then have your hyperlink call it.

Code: Select all

<SCRIPT>
function updateParent( url )
{
 window.opener.location.href = url;	
}
</SCRIPT>

<a href="javascript:updateParent('http://www.apple.com');">Apple</a>
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
Post Reply