Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Hi, stupid popup question

Reply
Thread Tools

Hi, stupid popup question

 
 
Shaun McKinnon
Guest
Posts: n/a
 
      11-12-2003
HI...Here's my problem...I have a popup window that loads when i want it to,
but it's not sized properly. I've set the size, but it doesn't seem to
work. I've been on 8 different websites to find out what i'm doing wrong,
and so far it seems i'm doing it the right way. Here's my code...any
suggestions would be appreciated.

<script language="javascript">
<!--
window.open("256fx/index.htm", "", "height=400, width=600");
//-->
</script>


 
Reply With Quote
 
 
 
 
Michael Winter
Guest
Posts: n/a
 
      11-12-2003
"Shaun McKinnon" wrote on 12/11/2003:

> HI...Here's my problem...I have a popup window that loads when i

want it to,
> but it's not sized properly. I've set the size, but it doesn't seem

to
> work. I've been on 8 different websites to find out what i'm doing

wrong,
> and so far it seems i'm doing it the right way. Here's my

code...any
> suggestions would be appreciated.
>
> <script language="javascript">


Use type="text/javascript" instead of the 'language' attribute.

> <!--
> window.open("256fx/index.htm", "", "height=400, width=600");
> //-->
> </script>


This works fine on IE 6, however you shouldn't include spaces in the
features list. Change it to 'height=400,width=600'. That might be
the problem if you're testing this with a stricter browser.

Mike

--
Michael Winter
M.Winter@[no-spam]blueyonder.co.uk (remove [no-spam] to reply)


 
Reply With Quote
 
 
 
 
Shaun McKinnon
Guest
Posts: n/a
 
      11-12-2003

Didn't work for me for some reason, but thanks Mike.

The funny thing is, is that it opens as 400x600, but then it explodes to the
size of the desktop...

here's what i want to do:

Customer goes to www.whatever.com/
this takes them to index.html which then opens popup index.htm
the main page is just a simple graphic thats 400x600, with a few flash
buttons (more of an ad)
it's obviously in the center (still have to learn how to script that).

Any suggestions???

Shaun McKinnon


 
Reply With Quote
 
Michael Winter
Guest
Posts: n/a
 
      11-12-2003
"Shaun McKinnon" wrote on 12/11/2003:

> Didn't work for me for some reason, but thanks Mike.
>
> The funny thing is, is that it opens as 400x600, but then it

explodes to the
> size of the desktop...
>
> here's what i want to do:
>
> Customer goes to www.whatever.com/
> this takes them to index.html which then opens popup index.htm
> the main page is just a simple graphic thats 400x600, with a few

flash
> buttons (more of an ad)
> it's obviously in the center (still have to learn how to script

that).

You still haven't mentioned what browser you're using. I don't think
I could help you even if you did say what it was, but someone else
might be able to. I'm frankly at a loss for what would cause your
window to maximize like that. Out of pure curiosity, could you try
this exact string (don't change a thing, please)? I have a theory,
but I might be way off the mark...

<A href="#" onclick="window.open('about:blank', 'about_blank',
'height=400,width=600'); return false">Test</A>

As for centring, that's fairly simple. Check the 'screen' object.
It's properties include the user's monitor dimensions, amongst other
things. Of course, until your maximizing problem is fixed, centring
is useless.

Mike

--
Michael Winter
M.Winter@[no-spam]blueyonder.co.uk (remove [no-spam] to reply)


 
Reply With Quote
 
Richard Cornford
Guest
Posts: n/a
 
      11-13-2003
"Michael Winter" <M.Winter@[no-spam]blueyonder.co.uk> wrote in message
news:hOzsb.2299$...
<snip>
>... . I'm frankly at a loss for what would cause your
> window to maximize like that. ...

<snip>

My suspicion is that Shaun is using cut-and-paste scripts without
understanding what they do or how they work and has included a script
with a call to window.resizeTo (or resizeBy) that is expanding the
window. It certainly isn't something that I would expect to happen
without some sort of instruction to do so. (Then again it might be some
sort of ill-conceived free web host inserted script.)

>As for centring, that's fairly simple. Check the 'screen'
>object. It's properties include the user's monitor dimensions,
>amongst other things. Of course, until your maximizing problem
>is fixed, centring is useless.


Centring windows is not as simple as just reading the screen dimensions
and positioning the window accordingly. Apart from being a meaningless
action in a tabbed browser, problems occur with, say, the MDI interface
on Opera, where screen dimensions reflect the desktop but window
positing instructions are relative to the outer window of the interface,
meaning that an attempt to position a window based on the screen
dimensions stands a very realistic chance of resulting in a window that
is entirely out of site. Multi-monitor displays are another stumbling
block as positioning based on screen dimension may result in the window
being opened across the screen boundaries, partly out of the displayable
desktop area and/or on a different monitor to the browser window, where
it may go unnoticed.

Unfortunately, without any mechanism for determining the type of
multi-monitor display (if any) being used, whether the browser is MDI or
tabbed, or any combination of these, the only reliable approach to
positioning windows is to make no specification at all. In response most
browsers will open a new window over the existing window, the one place
that you can be fairly certain that it will be apparent and fully
visible to the user (subject to scriptable window opening being allowed
at all).

Richard.


 
Reply With Quote
 
Shaun McKinnon
Guest
Posts: n/a
 
      11-13-2003
Hi, no it's not a cut and paste script (forbid)...It's one of Dreamweavers
wonderful drop in scripts that doesn't work worth a damn.
the script does not have an included call either. I posted the script that
i used.

Shaun McKinnon

"Richard Cornford" <> wrote in message
news:boular$mie$1$...
> "Michael Winter" <M.Winter@[no-spam]blueyonder.co.uk> wrote in message
> news:hOzsb.2299$...
> <snip>
> >... . I'm frankly at a loss for what would cause your
> > window to maximize like that. ...

> <snip>
>
> My suspicion is that Shaun is using cut-and-paste scripts without
> understanding what they do or how they work and has included a script
> with a call to window.resizeTo (or resizeBy) that is expanding the
> window. It certainly isn't something that I would expect to happen
> without some sort of instruction to do so. (Then again it might be some
> sort of ill-conceived free web host inserted script.)
>
> >As for centring, that's fairly simple. Check the 'screen'
> >object. It's properties include the user's monitor dimensions,
> >amongst other things. Of course, until your maximizing problem
> >is fixed, centring is useless.

>
> Centring windows is not as simple as just reading the screen dimensions
> and positioning the window accordingly. Apart from being a meaningless
> action in a tabbed browser, problems occur with, say, the MDI interface
> on Opera, where screen dimensions reflect the desktop but window
> positing instructions are relative to the outer window of the interface,
> meaning that an attempt to position a window based on the screen
> dimensions stands a very realistic chance of resulting in a window that
> is entirely out of site. Multi-monitor displays are another stumbling
> block as positioning based on screen dimension may result in the window
> being opened across the screen boundaries, partly out of the displayable
> desktop area and/or on a different monitor to the browser window, where
> it may go unnoticed.
>
> Unfortunately, without any mechanism for determining the type of
> multi-monitor display (if any) being used, whether the browser is MDI or
> tabbed, or any combination of these, the only reliable approach to
> positioning windows is to make no specification at all. In response most
> browsers will open a new window over the existing window, the one place
> that you can be fairly certain that it will be apparent and fully
> visible to the user (subject to scriptable window opening being allowed
> at all).
>
> Richard.
>
>



 
Reply With Quote
 
Shaun McKinnon
Guest
Posts: n/a
 
      11-13-2003
I'll try that string Mike...Thanks again for you help.

Shaun McKinnon
ps: it's IE 6

"Michael Winter" <M.Winter@[no-spam]blueyonder.co.uk> wrote in message
news:hOzsb.2299$...
> "Shaun McKinnon" wrote on 12/11/2003:
>
> > Didn't work for me for some reason, but thanks Mike.
> >
> > The funny thing is, is that it opens as 400x600, but then it

> explodes to the
> > size of the desktop...
> >
> > here's what i want to do:
> >
> > Customer goes to www.whatever.com/
> > this takes them to index.html which then opens popup index.htm
> > the main page is just a simple graphic thats 400x600, with a few

> flash
> > buttons (more of an ad)
> > it's obviously in the center (still have to learn how to script

> that).
>
> You still haven't mentioned what browser you're using. I don't think
> I could help you even if you did say what it was, but someone else
> might be able to. I'm frankly at a loss for what would cause your
> window to maximize like that. Out of pure curiosity, could you try
> this exact string (don't change a thing, please)? I have a theory,
> but I might be way off the mark...
>
> <A href="#" onclick="window.open('about:blank', 'about_blank',
> 'height=400,width=600'); return false">Test</A>
>
> As for centring, that's fairly simple. Check the 'screen' object.
> It's properties include the user's monitor dimensions, amongst other
> things. Of course, until your maximizing problem is fixed, centring
> is useless.
>
> Mike
>
> --
> Michael Winter
> M.Winter@[no-spam]blueyonder.co.uk (remove [no-spam] to reply)
>
>



 
Reply With Quote
 
Shaun McKinnon
Guest
Posts: n/a
 
      11-13-2003
Hey MIKE!!!

That worked..Thanks alot. I'll customize it for my usage.

Shaun McKinnon

"Michael Winter" <M.Winter@[no-spam]blueyonder.co.uk> wrote in message
news:hOzsb.2299$...
> "Shaun McKinnon" wrote on 12/11/2003:
>
> > Didn't work for me for some reason, but thanks Mike.
> >
> > The funny thing is, is that it opens as 400x600, but then it

> explodes to the
> > size of the desktop...
> >
> > here's what i want to do:
> >
> > Customer goes to www.whatever.com/
> > this takes them to index.html which then opens popup index.htm
> > the main page is just a simple graphic thats 400x600, with a few

> flash
> > buttons (more of an ad)
> > it's obviously in the center (still have to learn how to script

> that).
>
> You still haven't mentioned what browser you're using. I don't think
> I could help you even if you did say what it was, but someone else
> might be able to. I'm frankly at a loss for what would cause your
> window to maximize like that. Out of pure curiosity, could you try
> this exact string (don't change a thing, please)? I have a theory,
> but I might be way off the mark...
>
> <A href="#" onclick="window.open('about:blank', 'about_blank',
> 'height=400,width=600'); return false">Test</A>
>
> As for centring, that's fairly simple. Check the 'screen' object.
> It's properties include the user's monitor dimensions, amongst other
> things. Of course, until your maximizing problem is fixed, centring
> is useless.
>
> Mike
>
> --
> Michael Winter
> M.Winter@[no-spam]blueyonder.co.uk (remove [no-spam] to reply)
>
>



 
Reply With Quote
 
Michael Winter
Guest
Posts: n/a
 
      11-13-2003
"Richard Cornford" wrote on 13/11/2003:

> "Michael Winter" <M.Winter@[no-spam]blueyonder.co.uk> wrote in

message
> news:hOzsb.2299$...
> <snip>
> >... . I'm frankly at a loss for what would cause your
> > window to maximize like that. ...

> <snip>
>
> My suspicion is that Shaun is using cut-and-paste scripts without
> understanding what they do or how they work and has included a

script
> with a call to window.resizeTo (or resizeBy) that is expanding the
> window. It certainly isn't something that I would expect to happen
> without some sort of instruction to do so. (Then again it might be

some
> sort of ill-conceived free web host inserted script.)
>
> >As for centring, that's fairly simple. Check the 'screen'
> >object. It's properties include the user's monitor dimensions,
> >amongst other things. Of course, until your maximizing problem
> >is fixed, centring is useless.

>
> Centring windows is not as simple as just reading the screen

dimensions
> and positioning the window accordingly. Apart from being a

meaningless
> action in a tabbed browser, problems occur with, say, the MDI

interface
> on Opera, where screen dimensions reflect the desktop but window
> positing instructions are relative to the outer window of the

interface,
> meaning that an attempt to position a window based on the screen
> dimensions stands a very realistic chance of resulting in a window

that
> is entirely out of site. Multi-monitor displays are another

stumbling
> block as positioning based on screen dimension may result in the

window
> being opened across the screen boundaries, partly out of the

displayable
> desktop area and/or on a different monitor to the browser window,

where
> it may go unnoticed.
>
> Unfortunately, without any mechanism for determining the type of
> multi-monitor display (if any) being used, whether the browser is

MDI or
> tabbed, or any combination of these, the only reliable approach to
> positioning windows is to make no specification at all. In response

most
> browsers will open a new window over the existing window, the one

place
> that you can be fairly certain that it will be apparent and fully
> visible to the user (subject to scriptable window opening being

allowed
> at all).


Your point is well taken. I'm sheltered from the features of most
browsers out there. They've proved far too unstable on my system in
the past. I loved Opera, but it crashed - sometimes taking the kernel
with it - regularly. I've got enough problems with stability as it is
at the moment, I don't need more possible causes.

A few counter points:

1) You can't place windows off-screen. Scripts have to be signed to
do that (unless that restriction was removed after 1.3 - I haven't
finished reading up on DOM and the later JS versions yet), and the OPs
won't be.
2) As you say, positioning is meaningless for tabbed browsers. They
will ignore such positioning statements, so it won't matter. The user
just won't see quite what the author intended.
3) The browsers create the screen object. It would be logical to
assume that an MDI browser would report the dimensions of the MDI
window, and not that of the entire monitor. In my opinion, I see no
point in reporting the existence of pixels you can't use. Whether the
browser developers see it that way is of course, another matter and
one that is a waste of time debating (good to note, though).

Mike

--
Michael Winter
M.Winter@[no-spam]blueyonder.co.uk (remove [no-spam] to reply)


 
Reply With Quote
 
Michael Winter
Guest
Posts: n/a
 
      11-13-2003
"Shaun McKinnon" wrote on 13/11/2003:

> Hey MIKE!!!
>
> That worked..Thanks alot. I'll customize it for my usage.


No problem. It appears that because you didn't name the window
(second parameter), IE ignored the features list. 'name' is required.
Thomas Lahn also suggested this in your other thread.

Mike

> Shaun McKinnon
>
> "Michael Winter" <M.Winter@[no-spam]blueyonder.co.uk> wrote in

message
> news:hOzsb.2299$...
> > "Shaun McKinnon" wrote on 12/11/2003:
> >
> > > Didn't work for me for some reason, but thanks Mike.
> > >
> > > The funny thing is, is that it opens as 400x600, but then it

> > explodes to the
> > > size of the desktop...
> > >
> > > here's what i want to do:
> > >
> > > Customer goes to www.whatever.com/
> > > this takes them to index.html which then opens popup index.htm
> > > the main page is just a simple graphic thats 400x600, with a few

> > flash
> > > buttons (more of an ad)
> > > it's obviously in the center (still have to learn how to script

> > that).
> >
> > You still haven't mentioned what browser you're using. I don't

think
> > I could help you even if you did say what it was, but someone else
> > might be able to. I'm frankly at a loss for what would cause your
> > window to maximize like that. Out of pure curiosity, could you

try
> > this exact string (don't change a thing, please)? I have a

theory,
> > but I might be way off the mark...
> >
> > <A href="#" onclick="window.open('about:blank', 'about_blank',
> > 'height=400,width=600'); return false">Test</A>
> >
> > As for centring, that's fairly simple. Check the 'screen' object.
> > It's properties include the user's monitor dimensions, amongst

other
> > things. Of course, until your maximizing problem is fixed,

centring
> > is useless.
> >
> > Mike
> >
> > --
> > Michael Winter
> > M.Winter@[no-spam]blueyonder.co.uk (remove [no-spam] to reply)
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
stupid, STUPID question! rincewind HTML 25 05-08-2009 01:07 PM
stupid question...waiting for a stupid answer Brandon McCombs Java 4 08-28-2006 06:57 PM
Stupid question. Please, only stupid responders. If you're not sureif you're stupid, you probably aren't. =?ISO-8859-1?Q?R=F4g=EAr?= Computer Support 6 07-18-2005 05:11 AM
stupid stupid stupid kpg MCSE 17 11-26-2004 02:59 PM
Main > Popup > Popup > Close popup AND new URL in main? Jens Peter Hansen Javascript 7 06-19-2004 08:56 PM



Advertisments