URL=Javascrip....

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
kkaiser
Beginner
Beginner
Posts: 7
Joined: Mon Dec 29, 2003 3:14 pm

URL=Javascrip....

Post by kkaiser »

In version 3 a menu item might look like this;

,"Scoutmasters Heaven", "javascript:openNewWindow(\"http://kaiserklan.com/roundtable/poems/ ... izable=yes\")",,,0

This was converted for version 5 to;

aI("text=Scoutmasters Heaven;url=javascript:openNewWindow(\http://kaiserklan.com/roundtable/poems/ ... izable=yes\);");

But this is not right, I keep getting an error on line 1 of what I assume is the function which is below, does anyone have an idea how it should look? I've played with just about every combination of symbols I can think of.

<script language="javascript">
function openNewWindow(winURL,winWidth,winHeight,winConfig){
var winl = (screen.width - winWidth) / 2;
var wint = (screen.height - winHeight) / 2;
mmConfig=""
mmConfig="width="+winWidth+","
mmConfig+="height="+winHeight+","
mmConfig+="top="+wint+","
mmConfig+="left="+winl+","
mmConfig+="scrollbars=true,"
mmConfig+=winConfig
var mmWin=open(winURL,"",mmConfig);
mmWin.focus();
}
</script>


Thanks ...
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Hi,

Try using single quotes around the function call's string parameter instead of double quotes, like this:

Code: Select all

aI("text=Scoutmasters Heaven;url=javascript:openNewWindow('http://kaiserklan.com/roundtable/poems/Scoutmastersheaven.html\',650,425,'resizable=yes');");
That should work. There's also a new method in v5 that does not require you to have the openNewWindow() function, using the target and targetfeatures menu item properties. You'll find a discussion of the new approach in sample 11.

Hope that helps,

Kevin
kkaiser
Beginner
Beginner
Posts: 7
Joined: Mon Dec 29, 2003 3:14 pm

Thank You

Post by kkaiser »

Thanks ever so much, it works great.
Post Reply