resize browser window on load

C

chris

how would i resize a browser window to a specific size as the page loads,
using html or javascript
 
A

Andrew Thompson

how would i resize a browser window to a specific size as the page loads,
using html or javascript

Why? What is in the pages?

Most of the time it is better to design a
page that fits any screen and let the user
retain control of the size themselves.

Please note that cross-posting to three groups
is generally frowned upon, though I note that
you were unsure which group was best and
did not commit the 'sin' of multi-posting..

I will set the Follow-Ups to the best group,
should you decide to do such a thing,
comp.lang.javascript.

(While the HTML folks might be more aware of
how to make a page 'squeezy', the JS guru's
are certainly familiar with it.)
 
K

Karl Groves

chris said:
how would i resize a browser window to a specific size as the page loads,
using html or javascript

Leave the user's window alone.
It might be your website, but it is their computer.

-Karl
 
M

McKirahan

chris said:
how would i resize a browser window to a specific size as the page loads,
using html or javascript

<html>
<head>
<title>resizeto.htm</title>
</head>
<body onload="moveTo(0,0); resizeTo(400,300);">
</body>
</html>
 
K

Karl Groves

McKirahan said:
<html>
<head>
<title>resizeto.htm</title>
</head>
<body onload="moveTo(0,0); resizeTo(400,300);">
</body>
</html>


Congratulations. You've shown the OP a great way to confuse and annoy
visitors.

-Karl
 
R

Randy Webb

Karl said:
Congratulations. You've shown the OP a great way to confuse and annoy
visitors.

Not only that, but a method that fails in some scenarios.
 
S

Sam Hughes

Congratulations. You've shown the OP a great way to confuse and annoy
visitors.

So you think we should hide information from them?

The next thing you know, we'll stop teaching chemistry in high school, lest
anybody figure out how to make a bomb.
 
S

Sam Hughes

chris said:
how would i resize a browser window to a specific size as the page
loads, using html or javascript

The real question is, how could you design your page better so it doesn't
need this behavior. After all, you can't do what you want on many
browsers, including ones with javascript selectively turned on.
 
N

Neal

d02.news.aol.com:

So you think we should hide information from them?

The next thing you know, we'll stop teaching chemistry in high school,
lest
anybody figure out how to make a bomb.

There's a difference, in my opinion.

First, if we teach the chemical method of producing a huge explosion, we
also must responsibly mention that it's probably not a good idea to do
this in your basement or classroom.

Second, and I've used this analogy before, if someone wrote to you asking
what the best methods of suicide were, and it was clear from their message
that the question was not merely academic, I'm sure you'd be reluctant to
entertain the idea of suicide with this person. Rather, I'd hope you'd
attempt to help them out of their current situation toward a more healthy
one.

When people ask questions which are not answerable directly without ending
up as suporting poor practice, and we do so anyway, we're advising someone
to do something which is bad for the web.

This is why so many questions here are answered with "Why do you want to
do this? It's going to lead to no good." Because it's the only responsible
answer.
 
S

Sam Hughes

When people ask questions which are not answerable directly without
ending up as suporting poor practice, and we do so anyway, we're
advising someone to do something which is bad for the web.

This is why so many questions here are answered with "Why do you want
to do this? It's going to lead to no good." Because it's the only
responsible answer.

But alas, in this case, other people have already given that aspect of the
answer.
 
A

Andrew Thompson

So you think we should hide information from them?

What, the visitors? No, of course not.
Ohh.. if you mean the naiive web-authors? Probably.
The next thing you know, we'll stop teaching chemistry in high school,

Nobody ever needed Javascript to make
bread rise, or perform an alkilinity
or soil or water test...
..lest anybody figure out how to make a bomb.

I do not think there is any case to compare the two.

[ F'Ups set to c.l.js ]
 
K

Karl Groves

Sam Hughes said:
So you think we should hide information from them?

The next thing you know, we'll stop teaching chemistry in high school, lest
anybody figure out how to make a bomb.

A plethora of lessons learned today on alt.html.
Ladies and Gentlemen, Mr. Hughes has just demonstrated the "slippery slope".

-Karl
 
T

Toby Inkster

Sam said:
The next thing you know, we'll stop teaching chemistry in high school, lest
anybody figure out how to make a bomb.

Teach Chemistry by all means, but if a student comes up to you and asks
for a recipe for Semtex, be suspicious.
 
D

Dr John Stockton

JRS: In article <[email protected]>, dated Mon, 6
Sep 2004 09:27:13, seen in Karl Groves
Leave the user's window alone.
It might be your website, but it is their computer.

Setting the window size is a perfectly reasonable thing to do, in some
circumstances.

Consider <URL:http://www.merlyn.demon.co.uk/js-quick.htm>; it is
primarily for my benefit as a local page, but I publish it so that
others may make modify and use their own local copy. It presents some
controls in a form, and sizes itself to fit those controls in my
browser. IIRC, it also fits in MSIE 5.5 or 6; those with browsers in
which it does not fit can adjust the numbers.

Consider my private local home page; it has
<BODY onLoad="window.resizeTo(640, 960)">
because that suits my way of working (/inter alia/, I can normalise the
size of a displayed page by Home, Back).


Granted, resizing can be, and commonly is, misused; but there is no
reason to assert that the poster must want to misuse it. A conditional
warning is enough.


After resizing, one may wish to scroll to a particular location. There
are numerical scrolling commands; but it may be better to set focus to a
suitable element, so that the desired point is reached even if more text
is added above it.
 
W

WebcastMaker

There's a difference, in my opinion.
First, if we teach the chemical method of producing a huge explosion, we
also must responsibly mention that it's probably not a good idea to do
this in your basement or classroom.

That's kind of what happened here. The information was supplied, and
the warning was also given. Different posts, but it happened.
 
N

Neal

That's kind of what happened here. The information was supplied, and
the warning was also given. Different posts, but it happened.

True, but when one supplies the info without themselves attaching a
caveat, it sends the message that it's acceptable and no harm will come.
That's like a chemistry teacher telling the kids how to make LSD and the
DARE officer [1] telling them drugs are bad. It's the responsibility of
the chemistry teacher to say that while this is how it's done, it's ilegal
and dangerous and inadvisable and all that.

[1] For those who don't know, DARE = Drug and Alcohol Resistance
Education, a particularly popular (and debatably successful) school
program in the US. A police officer teaches the classes within the school
day.
 
W

WebcastMaker

That's kind of what happened here. The information was supplied, and
the warning was also given. Different posts, but it happened.
True, but when one supplies the info without themselves attaching a
caveat, it sends the message that it's acceptable and no harm will come.
That's like a chemistry teacher telling the kids how to make LSD and the
DARE officer [1] telling them drugs are bad.

well hardly similar, but the point is noted.
 
M

McKirahan

nice.guy.nige said:
[f-u set to alt.html]
While the city slept, McKirahan ([email protected]) feverishly typed...
<body onload="moveTo(0,0); resizeTo(400,300);">

Every time you use that script, god kills a kitten...

Cheers,
Nige

--
Nigel Moss
http://www.nigenet.org.uk
Mail address not valid. (e-mail address removed), take the DOG. out!
In the land of the blind, the one-eyed man is very, very busy!

Which god; my God starts with a capital G. :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top