How do you make a page open in a specific height and width using javascript? I am building a web site and I want the first page by default to open up in a specific width and height. I konw how to open a new window in a specific height and width using javascript, but I dont know how to make the first page open up in a specific size. Is there any way to do this using Javascript?
__________________________
keyword research ~ keyword tool ~ keyword tracking ~ affiliate elite
javascript
Moderator: General Moderators
Re: javascript
Code: Select all
<script type="text/javascript">
function popup(url, width, height)
{
window.open(url, "width=" + width + ", height=" + height);
}
</script>
<a href="popup('google.com', 500, 400)">Open a mini google window!</a>
Re: javascript
The opening page url you are using is passed to the function when we call it, so that this function can be used for any number of different pop-ups though the height/width and other options will always be the same unless you modify the function to take more arguments. Some browsers prohibit the opening of pages on another server for security reasons. It is better to test your script again.