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:22

Opening url link in new window


Poster: apbristow
Dated: Saturday December 10 2005 - 19:41:15 GMT

I may be missing something but I simply cannot get a URL link to open a new window?

I am using syntax

aI("image=example.gif;text=Example;url=https://www.example.co.uk;target=new");

Can anyone advise what I am doing wrong.

Andy

More info


Poster: apbristow
Dated: Saturday December 10 2005 - 20:43:22 GMT

Sorry - should also have added that I am using a licensed/registered version of Menu Milonic style Sample 78 Ver 5.736.


Poster: Ruth
Dated: Sunday December 11 2005 - 2:02:35 GMT

Hi,

It's been reported and I'm sure Milonic is working since they work pretty quickly to fix any bugs.

Ruth


Poster: Shap5202
Dated: Wednesday December 14 2005 - 3:35:00 GMT

I apologize in advance if this is something you know and just didn't want to do, but I didnt know the background :)

You could always just do the open in a new window yourself if you don't want to wait for a fix.

Just add a javascript method to your html
Code:
<script>
function openWindow(url){
        window.open(url);
}
</script>


again, if my post is pointless for you.. please disregard... just didnt have anything better to do on a tuesday night :)
along with
Code:
aI("image=example.gif;text=Example;url=javascript:openWindow('https://www.example.co.uk');");


Poster: jencam
Dated: Friday December 16 2005 - 12:22:13 GMT

I tried that javascript with the code also and it didn't work. If I add the javascript to a page won't it open every page in a new window when you might not want it to?


Poster: bobwill
Dated: Friday December 16 2005 - 12:47:17 GMT

I thought syntax was target='new' or target=_new. I used target=_blank using lates version of menu and it works fine...


Poster: jencam
Dated: Friday December 16 2005 - 15:57:57 GMT

Great. Can you explain how it goes?

Like we have
Code:
aI("text=Domains and hosting;url=http://www.ozhub.com;");


Can you tell me how to put the _blank in? I've tried it and it didn't work.


Poster: bobwill
Dated: Friday December 16 2005 - 16:11:23 GMT

Here is an example:

aI("text=Birth Certificate Search;url=http://www.vitalchek.com/;target=_blank;status=Order a Birth Certificate;separatorsize=1;");

Make sure that you do not put a space after the "target=", just all one word. "target=_blank"

Hope this helps...


Poster: jencam
Dated: Friday December 16 2005 - 16:19:53 GMT

Yeah that worked. Brilliant. Thanks a heap.


Poster: Ruth
Dated: Friday December 16 2005 - 16:37:06 GMT

Hi,

The newest version [pre-release at this point, 5.737] has fixed the open a new window problem I believe.

As to using a function to open a new window:

Code:
var newwindow;
function poptastic(url)
{
   newwindow=window.open(url,'name','height=500,width=400,left=100,
  top=100,resizable=yes,scrollbars=yes,toolbar=yes,status=yes');

}


If you put the function into the menu_data.js file and call it from particular links, it will only open that page in a new window. I'm using the one above because it's one I've used before. You would put that at the top of you menu_data.js file, note there are no script tags. Then in the aI strng you'd code it as


Code:
aI("text=item;url=javascript:poptastic('http://whatever/');");


Note that I"ve put the window features into the function so you wouldn't use targetfeatures= in the aI, also note that not all browsers will accept all the features, for example, some will not read top= and left= and allow you to position the window.

For information on target features check this site
http://www.devguru.com/Technologies/ecm ... _open.html

Ruth


Poster: jencam
Dated: Friday December 16 2005 - 17:41:58 GMT

Hi,
I've found the way I did it worked.

I don'tthink I have the altest version. But if you put that script in menu_data.js file wouldn't it open every link in this new window?

If you don't add it to the links you want opening in anew window?


Poster: Ruth
Dated: Friday December 16 2005 - 17:47:19 GMT

No, if you put it in the menu_data.js file the only links that would open in a new window are the ones that have the call for the function in the aI string
Code:
aI("text=item;url=javascript:poptastic('http://whatever/');");


However, I don't think you need a function, the newest version of the menu has fixed the open new window problem as far as I know so you can just use the internal new window
Code:
aI("text=item;url=whatever.htm;target=_new;targetfeatures=whatever features you want, or you can leave out target features;");


Ruth


Poster: jencam
Dated: Friday December 16 2005 - 17:58:05 GMT

Sorry. I just checked which version I have and it is Version 5.735
So the _blank works


Poster: erik_c
Dated: Friday December 16 2005 - 18:31:35 GMT

Ruth wrote:
Code:
var newwindow;
function poptastic(url)
{
   newwindow=window.open(url,'name','height=500,width=400,left=100,
  top=100,resizable=yes,scrollbars=yes,toolbar=yes,status=yes');

}


Code:
aI("text=item;url=javascript:poptastic('http://whatever/');");



When opening new windows, it's extra helpful to give them focus, just in case the "newwindow" reference is minimized or in the background.

Code:
var newwindow;
function poptastic(url)
{
   newwindow=window.open(url,'name','height=500,width=400,left=100,
  top=100,resizable=yes,scrollbars=yes,toolbar=yes,status=yes');
  newwindow.focus();
}


Poster: jencam
Dated: Friday December 16 2005 - 18:36:03 GMT

Absolutely. It is good to have the new window at a smaller size than usual. Will take note.

Target Windows - Now I get them where they weren't before!


Poster: burtg
Dated: Wednesday December 21 2005 - 16:40:41 GMT

On using Ver 5_734 and 5_738 I am geting a new browser window open up - when previously the pages just opened in the same window. Is this a bug?