javascript help?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Don't know if this is the right ng to be asking about jscript but here
goes ......

I designed a little function to resize a window based on the clients
screen resolution, and apply an appropriate background image.

function resize_2_spec()
if (screen.width>640)
window.resizeTo(800,600); = 'url(images/brunswickst600x800.jpg)';
window.resizeTo(640,480); = 'url(images/brunswickst480x640.jpg)';        

Problem is: how do I test it?

What's the easiest way?

Also, do you think that would work?

Re: javascript help?

Dropkick Punt wrote:

Quoted text here. Click to load it

right click on the your screen
resolution...test the page

Re: javascript help?

Quoted text here. Click to load it

Why do you even want to do this?

I'm not one of the Javascripts luddites, who thinks all javascript is
bad and refuses to turn it on. In fact, many of the web apps I develop
really do *depend* javascript (the'yre for controlled deployment) while
I use it on nearly every regular site I develop to enhance content.

Having said that, if I visit a site that attempts to

    a) move my browser window
    b) resize my browser window

then I instantly see a company/developer who has no respect for me,
their potential client, and the way my computer is set up, so I leave.
Immediately. And I never go back!

Javascript should enhance page functionality. It should not step
outside the page and start messing with the way my applications have
been set up - I choose my browser window size and location. Not you.

Just my thoughts,


Thyme Online Ltd
Caribbean Web Design /

Re: javascript help?

Ben Jamieson wrote:
Quoted text here. Click to load it
Quoted for emphasis =)

Re: javascript help?

Dropkick Punt wrote:

Quoted text here. Click to load it

1.  Read Ben's excellent explanation of why this is one of the worst
things you can do to annoy your users.

2.  Why are you resizing a WINDOW based on the size of a SCREEN ?
My display screen is 3200px wide, split over twin monitors. You might
be surprised to learn that I very rarely run any window at full monitor
size, and never at full display screen size.

Your idea is not only inherently a bad one, but the implementation of
it contains a glaring and harmful error.

If you really must, adjust the layour of your internal page according
to the size I've got my current window set at. Don't assume though that
your page should take any notice of my screen size. You don't display
on my _screen_, you display in the _window_ I've given you. If you
think messing with _my_ window is a good idea, refer to #1.

Site Timeline