Ewa
12-06-2002, 07:41 PM
Hello!
I really need some help with popup scripts. What I want is an automatic popup window to appear when I enter an URL. But thatīs not all.
Except for the script to just create a popup page, I want it to detect which browser that the visitor is using plus that I want, based on which browser, to be able to fill in width and height for each browsers (Netscape and Explorer).
The thing is, that when I in the beginning entered width and height to be followed by every browser, I found out that Netscape in these measurements counts in the title bar and Explorer doesnīt, so I therefor need to have different measures for each browser. Hereīs the script that Iīm using now, and which obviously does not work:
<SCRIPT LANGUAGE="javascript">
<!-- HIDE FROM OLDER BROWSERS
function popup() {
if (navigator.appName.indexOf('Netscape') != -1)
features = 'width=799,height=600,resizeble=no,scrollbars=yes, status=no,location=no,menubar=no,titlebar=no,direc tories=no,screenX=0,screenY=0';
else
features = 'width=799,height=603,resizeble=no,scrollbars=yes, status=no,location=no,menubar=no,titlebar=no,direc tories=no,left=0,top=0';
searchWin = window.open("index.asp",'_popup',features);
}
// END HIDING FROM OLDER BROWSERS -->
</SCRIPT>
</head>
<BODY onLoad="popup()" BACKGROUND="loginbild.jpg" BGCOLOR="#000000" bgproperties="fixed">
Iīm not sure if I should have the onLoad variable in the BODY tag or if I can manage perfectly without it. What happens when I run the page, is that it doesnīt become an automatic popup window, it simply opens up in the same window as I was earlier. So I have some problems with the popup variables... I mean how to get everything to work with detecting browsers and popup and so on. Can anyone help me?
Many many thanks,
Ewa.
I really need some help with popup scripts. What I want is an automatic popup window to appear when I enter an URL. But thatīs not all.
Except for the script to just create a popup page, I want it to detect which browser that the visitor is using plus that I want, based on which browser, to be able to fill in width and height for each browsers (Netscape and Explorer).
The thing is, that when I in the beginning entered width and height to be followed by every browser, I found out that Netscape in these measurements counts in the title bar and Explorer doesnīt, so I therefor need to have different measures for each browser. Hereīs the script that Iīm using now, and which obviously does not work:
<SCRIPT LANGUAGE="javascript">
<!-- HIDE FROM OLDER BROWSERS
function popup() {
if (navigator.appName.indexOf('Netscape') != -1)
features = 'width=799,height=600,resizeble=no,scrollbars=yes, status=no,location=no,menubar=no,titlebar=no,direc tories=no,screenX=0,screenY=0';
else
features = 'width=799,height=603,resizeble=no,scrollbars=yes, status=no,location=no,menubar=no,titlebar=no,direc tories=no,left=0,top=0';
searchWin = window.open("index.asp",'_popup',features);
}
// END HIDING FROM OLDER BROWSERS -->
</SCRIPT>
</head>
<BODY onLoad="popup()" BACKGROUND="loginbild.jpg" BGCOLOR="#000000" bgproperties="fixed">
Iīm not sure if I should have the onLoad variable in the BODY tag or if I can manage perfectly without it. What happens when I run the page, is that it doesnīt become an automatic popup window, it simply opens up in the same window as I was earlier. So I have some problems with the popup variables... I mean how to get everything to work with detecting browsers and popup and so on. Can anyone help me?
Many many thanks,
Ewa.