473,703 Members | 3,328 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

window.open / resizeTo problem

The following code opens a new window, but the "resizeTo" doesn't resize it.
Why not?

(Don't ask why I simply did not open the window with the new size....my
original problem was how to open a new window with maximized dimensions!)

FYI, I uploaded the same code to:
http://tosasoft.com/test/open.htm

=============== =============== ==========

<html>
<head>
<SCRIPT LANGUAGE="JavaS cript"><!--

function pgppopup() {
winobj1 = window.open('ht tp://www.yahoo.com/', 'mywin1',
'top=0,left=0,h eight=120,width =120,' +
'toolbar=yes,me nubar=yes,scrol lbars=yes,' +
'resizable=yes, location=yes,st atus=yes');
winobj1.resizeT o(600,400);
}

//--></SCRIPT>

</head>
<body>
<SCRIPT LANGUAGE="JavaS cript"><!--

window.onload = pgppopup;

//--></SCRIPT>

<h1>Test to Open and Resize</h1>

</body>
</html>

=============== =============== ==========
Jul 23 '05 #1
10 6752
David McCulloch said:
The following code opens a new window, but the "resizeTo" doesn't resize it.
Why not?

...


What browser are you using? Some browsers allow you to control whether or not scripts can open/resize/move/minimize/maximize windows - like Opera ;-).
Jul 23 '05 #2

"Mike Foster" <mi********@mfo sternospam.com> wrote in message
news:op******** ******@news.cha rter.net...
David McCulloch said:
The following code opens a new window, but the "resizeTo" doesn't resize it. Why not?

...


What browser are you using? Some browsers allow you to control whether or

not scripts can open/resize/move/minimize/maximize windows - like Opera ;-).

I am looking for generic code. As much as possible, I would like to be
compatible with the browsers most commonly in use today (IE6+, NS6/7, Opera
6/7, etc.).

I tested this code on IE6 under Windows XP and encountered the problem. Any
idea what the problem could be? Do you have the same problem when you click
on my web address? The window open'd window should be 600x400, not stuck at
120x120.
http://tosasoft.com/test/open.htm
Jul 23 '05 #3
"David McCulloch" <|@|.|> wrote in message
news:Vd******** **********@twis ter.rdc-kc.rr.com...

"Mike Foster" <mi********@mfo sternospam.com> wrote in message
news:op******** ******@news.cha rter.net...
David McCulloch said:
The following code opens a new window, but the "resizeTo" doesn't
resize
it. Why not?

...
What browser are you using? Some browsers allow you to control whether

or not scripts can open/resize/move/minimize/maximize windows - like Opera ;-).
I am looking for generic code. As much as possible, I would like to be
compatible with the browsers most commonly in use today (IE6+, NS6/7, Opera 6/7, etc.).

I tested this code on IE6 under Windows XP and encountered the problem. Any idea what the problem could be? Do you have the same problem when you click on my web address? The window open'd window should be 600x400, not stuck at 120x120.
http://tosasoft.com/test/open.htm


This fails silently on one of my computers, and shows:
"Error on Line 9, winobj1 is null or not an object"
on another, where I have script-debugging turned on.

Both of course because I'm using Google's PopUp Blocker.

--
Dag
58°26'15.9" N 008°46'45.5" E
Jul 23 '05 #4
DU
David McCulloch wrote:
"Mike Foster" <mi********@mfo sternospam.com> wrote in message
news:op******** ******@news.cha rter.net...
David McCulloch said:
The following code opens a new window, but the "resizeTo" doesn't resize
it.
Why not?

...
What browser are you using? Some browsers allow you to control whether or


not scripts can open/resize/move/minimize/maximize windows - like Opera ;-).

I am looking for generic code. As much as possible, I would like to be
compatible with the browsers most commonly in use today (IE6+, NS6/7, Opera
6/7, etc.).


Most people using browsers most commonly in use (MSIE 6, NS 7.x, Opera
7.x, Mozilla-based browsers, Safari 1.x, Konqueror 3.x, etc.) have
browser user prefs settings, add-ons, browser extensions which prevent
opening new window during load time and which prevent resizing of
existing windows and this is exactly what your code attempts to do.
There is a very wide consensus among current browser manufacturers on
giving absolute veto power to users over opening unsollicited windows
and on scripts resizing windows.
I tested this code on IE6 under Windows XP and encountered the problem. Any
idea what the problem could be?
Don't open secondary window during load process of a window.

Do you have the same problem when you click on my web address?
Yes. As your web address is still in the process of being loaded, your
code tries to open another window which I was not made aware of in the
first place. Why?

The window open'd window should be 600x400,

and then it tries to resize that window and this without notifying me in
advance and without my explicit consent to begin with.

not stuck at 120x120.
http://tosasoft.com/test/open.htm


As you start/open your tv or when you switch to a channel, would you
mind if the tv content provider would be able to open your other tv set
in your home?
When you start/open your tv or when you switch to a channel, would you
mind if the tv content provider would then be able to set the volume of
your other tv?

DU
Jul 23 '05 #5

"Dag Sunde" <ds@orion.no-way> wrote in message
news:lT******** *********@julie tt.dax.net...
"David McCulloch" <|@|.|> wrote in message
news:Vd******** **********@twis ter.rdc-kc.rr.com...

"Mike Foster" <mi********@mfo sternospam.com> wrote in message
news:op******** ******@news.cha rter.net...
David McCulloch said:
> The following code opens a new window, but the "resizeTo"
> doesn't resize it. Why not?
>
> ...

What browser are you using? Some browsers allow you to control
whether or not scripts can open/resize/move/minimize/maximize
windows - like Opera ;-).


I am looking for generic code. As much as possible, I would like to be
compatible with the browsers most commonly in use today (IE6+, NS6/7,
Opera 6/7, etc.).

I tested this code on IE6 under Windows XP and encountered the problem.
Any idea what the problem could be? Do you have the same problem
when you click on my web address? The window open'd window
should be 600x400, not stuck at 120x120.
http://tosasoft.com/test/open.htm


This fails silently on one of my computers, and shows:
"Error on Line 9, winobj1 is null or not an object"
on another, where I have script-debugging turned on.

Both of course because I'm using Google's PopUp Blocker.


I have been using Google's toolbar PopUp Blocker for a long time, too. Of
course, I enabled pop-ups on my site. With script-debugging enabled, I
don't see an error.

If you enable Google's pop-ups for my site (simply click the button that
shows the number of pop-ups blocked; you can disable it again by clicking a
second time), do you see the same problem?

Thanks very much for your help!

Dave
Jul 23 '05 #6

"DU" <dr*******@hotW IPETHISmail.com > wrote in message
news:cb******** **@news.eusc.in ter.net...
David McCulloch wrote:
"Mike Foster" <mi********@mfo sternospam.com> wrote in message
news:op******** ******@news.cha rter.net...
David McCulloch said:

> The following code opens a new window, but the "resizeTo" doesn't
> resize it. Why not?
>
>...

What browser are you using? Some browsers allow you to control
whether or not scripts can open/resize/move/minimize/maximize
windows - like Opera ;-).
I am looking for generic code. As much as possible, I would like to
be compatible with the browsers most commonly in use today
(IE6+, NS6/7, Opera 6/7, etc.).


Most people using browsers most commonly in use (MSIE 6, NS 7.x,
Opera 7.x, Mozilla-based browsers, Safari 1.x, Konqueror 3.x, etc.) have
browser user prefs settings, add-ons, browser extensions which prevent
opening new window during load time and which prevent resizing of
existing windows and this is exactly what your code attempts to do.
There is a very wide consensus among current browser manufacturers
on giving absolute veto power to users over opening unsollicited
windows and on scripts resizing windows.


Understood. My users definitely want the windows to open and will be
willing to authorize my site to open them.
I tested this code on IE6 under Windows XP and encountered the
problem. Any idea what the problem could be?


Don't open secondary window during load process of a window.


Technically, as part of the ONLOAD event, isn't it being opened AFTER the
first window has already been loaded? Are you suggesting that putting the
window.open into the ONLOAD event is causing this problem?
Do you have the same problem when you click
on my web address?


Yes.


Any idea why?
As your web address is still in the process of being loaded, your
code tries to open another window which I was not made aware of in
the first place. Why?
It's part of a much more involved application, whose core value is the
opening of several dedicated windows. The users definitely want and expect
them to open.
The window open'd window should be 600x400,

and then it tries to resize that window and this
without notifying me in advance and without my
explicit consent to begin with.


That would not be true in the context of my application. Its users
definitely want and expect multiple windows to open. Unfortunately, that's
not what is happening.
not stuck at 120x120.
http://tosasoft.com/test/open.htm


As you start/open your tv or when you switch to a channel, would you
mind if the tv content provider would be able to open your other tv set
in your home?
When you start/open your tv or when you switch to a channel, would you
mind if the tv content provider would then be able to set the volume of
your other tv?


Without going too far off-topic, suffice to say that I agree with you in
general terms (and in almost all situations), but that is really not an
issue here. On the contrary. Part of my application's core value to its
users is to do exactly that. Without knowing more details, I don't expect
you to understand, but if I can get it up and running, I plan to give
everyone (not just my family and friends) free access and you could see for
yourself. In the meantime, any help would be appreciated. Thanks!

Dave
Jul 23 '05 #7
David McCulloch wrote:
"Mike Foster" <mi********@mfo sternospam.com> wrote in message
news:op******** ******@news.cha rter.net...
David McCulloch said:
> The following code opens a new window, but the "resizeTo" doesn't resize

it.
> Why not?
>
> ...


What browser are you using? Some browsers allow you to control whether
or

not scripts can open/resize/move/minimize/maximize windows - like Opera
;-).

I am looking for generic code. As much as possible, I would like to be
compatible with the browsers most commonly in use today (IE6+, NS6/7,
Opera
6/7, etc.).

I tested this code on IE6 under Windows XP and encountered the problem.
Any
idea what the problem could be? Do you have the same problem when you
click
on my web address? The window open'd window should be 600x400, not
stuck at
120x120.
http://tosasoft.com/test/open.htm


I copied the code you posted and tried it on my local machine with
IE6/Win2K. I received an "access denied" error. When I changed the url to
a local file it worked properly. This may be related to the same security
issue when trying to access the DOM of a remote page.

David McCulloch wrote: (Don't ask why I simply did not open the window with the new size....my
original problem was how to open a new window with maximized dimensions!)


You could try the following but it actually opens the window larger than
it needs to be so you have to estimate how much to subtract.

'height=' + (screen.height-140) +
',width=' + (screen.width-10) + ',' +
Jul 23 '05 #8
"David McCulloch" <|@|.|> wrote in message
news:fI******** ***********@twi ster.rdc-kc.rr.com...

"Dag Sunde" <ds@orion.no-way> wrote in message
news:lT******** *********@julie tt.dax.net...
"David McCulloch" <|@|.|> wrote in message
news:Vd******** **********@twis ter.rdc-kc.rr.com...
<snipped/>
I tested this code on IE6 under Windows XP and encountered the problem. Any idea what the problem could be? Do you have the same problem
when you click on my web address? The window open'd window
should be 600x400, not stuck at 120x120.
http://tosasoft.com/test/open.htm
This fails silently on one of my computers, and shows:
"Error on Line 9, winobj1 is null or not an object"
on another, where I have script-debugging turned on.

Both of course because I'm using Google's PopUp Blocker.


I have been using Google's toolbar PopUp Blocker for a long time, too. Of
course, I enabled pop-ups on my site. With script-debugging enabled, I
don't see an error.

If you enable Google's pop-ups for my site (simply click the button that
shows the number of pop-ups blocked; you can disable it again by clicking

a second time), do you see the same problem?

No, this time I get an "Permission Denied" on the same line...

--
Dag
58°26'15.9" N 008°46'45.5" E
Jul 23 '05 #9
"David McCulloch" <|@|.|> writes:
Understood. My users definitely want the windows to open and will be
willing to authorize my site to open them.
Then your users are not average. Configuring the browser to allow some
pages to open windows requires a better knowledge of their browser
than what is needed to disable unrequested popups. It can easily be
beyond the ability of many users.

I suggest supplying a button or link that they can press to open the
window if it didn't open automatically.
Technically, as part of the ONLOAD event, isn't it being opened AFTER the
first window has already been loaded?
Yes. What really matters is that it is not prompted by a user input.
Clicking or pressing a key to activate a button means that the user
is supposed to have requested the result, and window opened in response
to such will work in the advanced popup blockers.
Are you suggesting that putting the window.open into the ONLOAD
event is causing this problem?
Definitly. Every popup blocker that I have seen will block that.
It's part of a much more involved application, whose core value is the
opening of several dedicated windows. The users definitely want and expect
them to open.


It's still a potential usability problem if the users are unable to make
them open.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 23 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
9708
by: Carol Lyn | last post by:
Could use your assistance with this. I have a window that opens via onclick and it is a small window with info about a site. If the user is interested in visiting that site, there is a link to click that opens the site in a new and larger window via onclick. My question is, can I have the smaller window automatically close when the user clicks the link to visit the site? I also have a link that merely closes the smaller info window if...
2
1861
by: Charles Packer | last post by:
From one of the online Javascript tutorials, I learned how to open a new window and set its size. I'm building a page that has several small photographs, and I want to let the viewer examine either a full size image or an image with supporting detail. It's the same idea used on lots of Web sites that show thumbnails where you click on one and the full-size image is displayed in a new window. However, I have different-sized images that will...
4
6330
by: Andrew Poulos | last post by:
If I use this code to maximise a browser window: window.moveTo(0,0); window.resizeTo(screen.width,screen.height); it works but on Windows the user can have a taskbar visible and the browser window goes behind it. Is there a way to know where the taskbar is?
6
5642
by: David Hayes | last post by:
juglesh <juglesh@nospamRadioKDUG.com> wrote in "Re: how to maximize the browser window that fits the monitor size?" (Saturday, January 01, 2005 3:12 AM): > > >I want to maximize the browser window when I open a new window. > > function expand() { > window.moveTo(0,0); > window.resizeTo(screen.availWidth, screen.availHeight); > }
2
2115
by: Saeed Sedighian | last post by:
Hello All. I open a window using showModalDialog function. (window.showModalDialog('webform2.htm',null,'resizable:yes')) In modal window after page loaded i want to change size of window using window.resizeTo(growWidth,growHeight) . but this not works. If page open with window.open anything works good.
3
2165
by: EnjoyNews | last post by:
I have a popup problem. I have a script that generates a popup for image viewing. It has 2 function, and the first is that it automaticly generates the popup window to the size of the image, and the second is that it closes the popup window when you click outside of it. It is a script I have found on the internet, since I have no experience in javascript coding.
2
11385
by: Francesco | last post by:
Hi, got a problem, hope someone could help: this function should open a popup showing an image automatically adjusting browser window's height and width. It works fine with IE6 but not with IE7. In IE7 opens popup too small. why ? function popImage(imageURL,imageTitle){ if (isNN){imgWin=window.open('about:blank','',optNN);}
9
2589
by: tshad | last post by:
This was posted before but the message got messed up (all NLs were stripped out for some reason). I have 2 labels that hold the name of different images on my .aspx page. <asp:Label ID="Logo" runat="server"/> <asp:Label ID="CompanyPicture" runat="server"/> I have 2 links that open the windows to preview these images. The previewed images are done on separate html pages that do nothing but display the
0
8662
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9243
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9002
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7853
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6585
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5922
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4420
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4677
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2057
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.