I am trying to modify my code to make it so user can choose the browser size they want.
original code
<script>
function PopUp()
{
// create vaiable to hold url
var url =(url);
// create vaiable to hold features
var features = 'left=0,top=0,';
features += 'screenX=0,screenY=0,';
features += 'width=500';
features += 'height=500';
// ask for the Url
url = window.prompt("Please enter the Url you want.", "");
//check to see if they typed a Url
if (url==null) //they hit Cancel
{
window.alert ("You must enter a Url!");
PopUp()
}
else if (url=="")
{
//user hit ok, but didn't type a Url
window.alert ("You must enter a Url!");
PopUp()
}
//if user typed a Url and clicked OK
if (window.confirm ("OK, Do you want to Resize window and position to top, left?"))
{
//open a new window with the given Url
window.alert ("OK, Going to the Url,re-positioning and re-sizing")
window.open (url,'',features);
}
else
//user hit cancel
{
window.alert ("Ok, will not resize window !");
//open a new window with the given Url
window.open (url);
}
}
</script>
please email me if you can help
<!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->
original code
<script>
function PopUp()
{
// create vaiable to hold url
var url =(url);
// create vaiable to hold features
var features = 'left=0,top=0,';
features += 'screenX=0,screenY=0,';
features += 'width=500';
features += 'height=500';
// ask for the Url
url = window.prompt("Please enter the Url you want.", "");
//check to see if they typed a Url
if (url==null) //they hit Cancel
{
window.alert ("You must enter a Url!");
PopUp()
}
else if (url=="")
{
//user hit ok, but didn't type a Url
window.alert ("You must enter a Url!");
PopUp()
}
//if user typed a Url and clicked OK
if (window.confirm ("OK, Do you want to Resize window and position to top, left?"))
{
//open a new window with the given Url
window.alert ("OK, Going to the Url,re-positioning and re-sizing")
window.open (url,'',features);
}
else
//user hit cancel
{
window.alert ("Ok, will not resize window !");
//open a new window with the given Url
window.open (url);
}
}
</script>
please email me if you can help
<!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->