The HTML I put in as the example didn’t appear, let me try again using the code thing:
<a href="http://www.google.com" target="_blank" onclick="window.open(this.href,this.target,'height=800, width=700');return false;"></a>
Hi Ed,
I’m not sure why you would need Javascript for that. If you check the ‘open in new window’ checkbox, the URL opens in another window/tab. Why would you want to use the code in your example?
Hi Bas,
Thanks for replying 🙂 Well, the reason is that I want to specify the height + width of the new window and I cannot see any way to do this in any of the settings?
So rather than request a feature from you, wanted to use something which you already had implemented! But just wanted to know how to use it.
Thanks
Edd
You might be better off by using some custom javascript in your theme, but I found a way to do it like this:
javascript:void window.open('http://www.google.com', '_blank', 'width=1024,height=768,status=0,resizable=0');
Hi Bas,
Thanks again – what exactly would go in the URL field here? I just tried this, but it doesn’t work – it opens a new window with javascript:void window.open('http//www.google.com', '_blank', 'width=1024,height=768,status=0,resizable=0') in the address bar?
Regards
In my firefox this opens google ( the URL there ) but it might be that other browser have another way of opening it. If it doesn’t work on other browser you’ll need some custom javascript to do it. By the way since the ages of tabbed browsers a lot of browser have less support for controlling how windows are being openened.
Hi Bas,
That’s strange, I put javascript:void window.open('http://www.google.com', '_blank', 'width=1024,height=768,status=0,resizable=0'); in and tried FireFox but it opens a blank tab ?
I realise the issue regarding tabbed browsers – this is why I’m using javascript to open it 🙂
Any ideas?
I tried exactly that and here it works (maybe the linux version is different who knows ) . But if other browsers don’t want to work with this, the only other option is adding some custom javascript to your site somewhere and call that.
Never mind! I have done it!
I needed to untick ‘Open in new window’ and it’s all working now.
Thanks for your assistance here
Edd
I forgot about that setting. Nice to know this works.
I have several functions in a file called functions.js and I would like to execute them from MaxButtons. Does the free or upgraded version support this? I have a snippet of the code below I would like to call.
function popup() {
alert(“Hello World”)
}
// ***************************************************************************************
function BetweenDates() {
var date1 = document.DateDiff.StartDate.value
var date2 = document.DateDiff.StopDate.value
var IncludeLastDay = document.DateDiff.IncludeLastDay.checked
date1 = date1.split(“-“);
date2 = date2.split(“-“);
var sDate = new Date(date1[0]+”/”+date1[1]+”/”+date1[2]);
var eDate = new Date(date2[0]+”/”+date2[1]+”/”+date2[2]);
var daysApart = Math.abs(Math.round((sDate-eDate)/86400000));
if (IncludeLastDay == true)
daysApart = daysApart + 1
var weeksApart = daysApart / 7
var LeftoverDays = daysApart % 7
document.DateDiff.TotalDays.value = daysApart
document.DateDiff.TotalWeeks.value = Math.floor(weeksApart)
document.DateDiff.LeftoverDays.value = LeftoverDays
}
Please open a new support topic next time. We don’t watch the resolved ones that much.
To answer, in the same way. Try to add javascript:void popup() to the URL field.