Setting the pagesize...but...

Posted on 2006-11-07
Last Modified: 2010-04-09
Hi Experts,

I want a page to open in a smaller size window.
This is what I use for that.

function resizeMe()
<body onload="resizeMe()">


It is used for a chat program, so it refreshes each 5 seconds. Sometimes the user will resize the window, ie. either they make it bigger or they make it smaller. But when the page refreshes, it is again going make to my initial settings.

What I want it the screen should open with the specified size for the first time. When the user resizes it, it should not get back to the initial size on refresh.

I think I have made it clear!
Question by:CWS (haripriya)
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
LVL 19

Expert Comment

ID: 17897381
Maybe the best way to do that is have the parent window set the size the way you want, and then just don't do anything in the onload for the popup.
LVL 16

Expert Comment

ID: 17901901
again - gotta agree with votey. =)

The page that is calling the pop up should be the one specifying the location and size of the window. You shouldn't even need to use the "refresh" to set the initial size.
LVL 16

Author Comment

by:CWS (haripriya)
ID: 17905050
I have already tried that.

The parent page is already having this resizeMe() function. So I removed that function in the child page so that it will not resize during each refresh. But, unfortunately it goes back to the old size. I have examined the code carefully , I tried clearing the cache also, but I wondering why it is talking the setting of the parent page.

More Info:

In the parent page I am using Response.Redirect to show this page.

Can u give the coding example for setting the window size from the parent. I will try your code and see.
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 19

Accepted Solution

VoteyDisciple earned 250 total points
ID: 17905477
Sure, something like...

<a href="'your-page.html', 'window-name', 'width=600,height=900');">Chat!</a>
LVL 16

Author Comment

by:CWS (haripriya)
ID: 17912023

I changed it like this.
<a href="'chat/intermain.asp','window-name','width=600, height=900');" target="_blank">

but it shows the window blank with the url,'chat/intermain.asp','window-name','width=600, height=900');

Now, what to do?
LVL 19

Expert Comment

ID: 17913825
Try it without the target="_blank" -- I suspect that gets processed before the browser realizes it's supposed to be running Javascript, not following an ordinary link.

If that doesn't work, move the command to the onclick propery (onclick="") but it should work either way.
LVL 16

Author Comment

by:CWS (haripriya)
ID: 17919988

This works for me.

<a href="#" onClick="'chat/intermain.asp','Chat','width=600,height=600,scrollbars, resizable');" >

I just googled and got this. But why we are giving "#" in the href ?
LVL 19

Expert Comment

ID: 17920997
There has to be an href, so if you don't want it to go anywhere the most common thing to do is have it link to # so the browser will stay on the same page and not reload it.
LVL 16

Author Comment

by:CWS (haripriya)
ID: 17928008
Thanks for all the help you have given.

Enjoy the points!

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question