Solved

Setting the pagesize...but...

Posted on 2006-11-07
9
159 Views
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.

<script>
function resizeMe()
{
     //self.moveTo(300,0);
     self.resizeTo(600,900);
     document.chatform.message.focus();
}
</script>
<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!
0
Comment
Question by:CWS (haripriya)
  • 4
  • 4
9 Comments
 
LVL 19

Expert Comment

by:VoteyDisciple
Comment Utility
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.
0
 
LVL 16

Expert Comment

by:ThinkPaper
Comment Utility
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.
0
 
LVL 16

Author Comment

by:CWS (haripriya)
Comment Utility
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.
0
 
LVL 19

Accepted Solution

by:
VoteyDisciple earned 250 total points
Comment Utility
Sure, something like...

<a href="javascript:window.open('your-page.html', 'window-name', 'width=600,height=900');">Chat!</a>
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 16

Author Comment

by:CWS (haripriya)
Comment Utility
oops....

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?
0
 
LVL 19

Expert Comment

by:VoteyDisciple
Comment Utility
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.
0
 
LVL 16

Author Comment

by:CWS (haripriya)
Comment Utility
Votey,

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 ?
0
 
LVL 19

Expert Comment

by:VoteyDisciple
Comment Utility
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.
0
 
LVL 16

Author Comment

by:CWS (haripriya)
Comment Utility
Thanks for all the help you have given.

Enjoy the points!
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

762 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now