• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 173
  • Last Modified:

Setting the pagesize...but...

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!
CWS (haripriya)
CWS (haripriya)
  • 4
  • 4
1 Solution
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.
ThinkPaperIT ConsultantCommented:
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.
CWS (haripriya)Author Commented:
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.
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

Sure, something like...

<a href="javascript:window.open('your-page.html', 'window-name', 'width=600,height=900');">Chat!</a>
CWS (haripriya)Author Commented:

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

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

Now, what to do?
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="window.open...") but it should work either way.
CWS (haripriya)Author Commented:

This works for me.

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

I just googled and got this. But why we are giving "#" in the href ?
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.
CWS (haripriya)Author Commented:
Thanks for all the help you have given.

Enjoy the points!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now