General :
K-Meleon Web Browser Forum
General discussion about K-Meleon
new window - javascript
Posted by:
Richard
Date: October 30, 2001 11:34PM
I'm brand new to K-Meleon., What a find!
I was checking out some of the sites I've developed and one, www.infozine.com has a problem with K-Mellon. Opening of new windows with javascript doesn't want to work, yet works with the other browsers. I'm wondering if this is K-Mellon or my scripting...<G> Can any one see anything here that would not make this script work in K-Mellon?
In the header
<script type='text/javascript' language='JavaScript'>
<!-- // Hide for old browsers
var newWindow = null;
function OpenWindow (Url,Title,Width,Height) {
var win_opt= 'toolbar=0,location=0,directories=0,status=0,menubar=0,';
win_opt += 'scrollbars=1,resizable=1,copyhistory=0,';
win_opt += 'width=' + Width + ',height=' + Height;
var windowX = (screen.width/2)-(Width/2);
var windowY = (screen.height/2)-(Height/2);
window.name = 'MainWindow';
newWindow = window.open('',Title,win_opt);
if (newWindow != null) {
if (newWindow.opener == null)
newWindow.opener = self;
newWindow.location.href = Url;
newWindow.moveTo(windowX,windowY);
if (newWindow.focus) newWindow.focus();
}
}
// End of script -->
</SCRIPT>
and the link is here:
<a href="javascript:OpenWindow('/news/terms.php','OpenWindow','600','400')">terms</a>
Thanks
Richard
www.infozine.com
Re: new window - javascript
Posted by:
Andrew
Date: October 30, 2001 11:39PM
Richard,
I believe this is a known bug in the embedded version of Mozilla that K-Meleon is built on. I
Andrew
Re: new window - javascript
Posted by:
Richard
Date: October 31, 2001 03:14PM
Thanks Andrew,
I mean it opens the window, correct size and all, but doesn't load the file in it. Dang...
Nice job anyway.
R
Re: new window - javascript
Posted by:
Andrew
Date: October 31, 2001 03:22PM
Richard,
Mozilla is working on that bug so as soon as they have a fix, we'll roll that into K-Meleon. It is an annoying bug.
Andrew
Re: new window - javascript
Posted by:
Brian
Date: October 31, 2001 03:58PM
There is a workaround though. The problem is basically you can't load a new page (via newWindow.location.href) until the 'default' about:blank page has been loaded first. So what you can do is delay a little bit to give it time to load about:blank before trying to set the new url.