tags:

views:

262

answers:

2

Hi! I am using function MM_openBrWindow() to open new window. Here is the javascript.

function MM_openBrWindow(theURL,winName,features) { //v2.0
     window.open(theURL,winName,features);
     return false;
}

This is how the function is called.

<a href="index.php" onclick="MM_openBrWindow('index.php','','scrollbars=yes,menubar=0,width='+screen.availWidth+',height='+screen.availHeight);return false"><img src="images/logo.jpg" alt="Logo" /></a>

Here pop up window is opened. For Firefox and IE it shows web address bar. The problem here is for safari. It does not show the address bar. Can anyone suggest me what may the problem.

Thanks

+1  A: 

try adding ,location=yes to your popup options

streetpc
Thanks streetpc! But it didn't work and another problem is that scroll bar is not displayed as well.
A: 

You could try adding in the locationbar property.

<a href="index.php" onclick="MM_openBrWindow('index.php','','scrollbars=yes,location=yes,locationbar=yes,menubar=no,width='+screen.availWidth+',height='+screen.availHeight);return false"><img src="images/logo.jpg" alt="Logo" /></a>

I'm not sure this will work, but you can always check all the available properties and try a few other combinations.

Edit: I've test this on Safari 3.1.1 and it works. You need both the location and the locationbar properties. If you want to make sure your script runs across all browsers, you need to make sure that you provide a value for all properties and not assume all browsers will default to the same value.

Kieran Hall