View Full Version : Help on browser window properties.
kelvinlym
03-05-2004, 03:09 AM
I would appreciate someone showing me how to get a browser window to
- load to a specified size
- at a specified position
- have no toolbars
- no scrollbars
-no address bar
I don't want this to be done from onClick of another page. It has to be onload of this page.
P.S. Just to let u know, I don't know much about javascript so I would greatly appreciate it if you tell me in painful detail how to do this. :oops:
Thanks
to resize window, use javascript window.resizeTo(width,height);
to move window, use javascript window.moveTo(X,Y);
to disable scrollbar, put into <BODY> <body scroll="auto">
sorry I can't help you for the other 2 ...
jiinjoo
03-05-2004, 06:50 AM
You can't change the address bar / tool bar for the current window. Details:
http://www.experts-exchange.com/Web/Web_Languages/JavaScript/Q_20782379.html
Thirdshifter
03-05-2004, 09:44 AM
Those attributes can be set on a popup window but are not valid for a conventional browser window.
Things like that can lead to deception, as shown in the following where the address bar was spoofed with a replacement: http://www.dslreports.com/forum/remark,9756213~mode=flat
Those attributes can be set on a popup window but are not valid for a conventional browser window.
window.resizeTo, window.moveTo, and scroll="auto" are valid for conventional non-popup windows (even though the window might look weird in a multitabbed browser) ... but if the attributes you meant are the other 2 (toolbar and address bar) then you're right :)
jiinjoo
04-05-2004, 02:55 AM
Those attributes can be set on a popup window but are not valid for a conventional browser window.
Things like that can lead to deception, as shown in the following where the address bar was spoofed with a replacement: http://www.dslreports.com/forum/remark,9756213~mode=flat
whoa, cool stuff - gave me great ideas :) *evil grin*
Actually kelvinlym, what are you pursuing that requires such stringent requirements? You should be able to still open a new full screen window with all those stuff. I see lots of flash websites do that for aesthetic reasons. Others do it for splash screen effect. What they usually do is to leave the browser in the back with some simple plain color (and a logo usually), and do all their magic with the pop-uped window. That way, the user still have his browser - imagine s/he wants to go visit some other page or go back to the previous page and his only browser loses its Back Button! Then he has to quit and restart the browser?
kelvinlym
04-05-2004, 03:02 PM
I just want to make a popup for getting people to register for my newsletter after they leave.
But I found a way without using javascript now.
i use <body onUnload="window.open('address.html', scrollbars=no etc)">
at first i wanted to make a window <body onload="insert window properties here"> but it can't cos the browser don't want people to open a window and suddenly all you have is a popup.
so i use body onunload for the main page and when visitor closes it, out pops out a message reminding my visitor to sign up for my newsletter. And this popup have all the window properties I defined. But they still have the original browser to navigate. At least it will not be so mean as in my first intention.
heh, I completely missed your point ... if that's the case then just use window.open() and put all those stuff you want in there .. and you can define lots of ways to call the function ...
i thought you wanted to modify the properties of the current window ....
vBulletin® v3.7.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.