...

View Full Version : popup help



angst
01-24-2006, 05:36 PM
hello,
i'm just trying to open a popup function from a button,
but I guess I'm doing something wrong,

my code:


<script>
function mypopup()
{
mywindow = window.open ("http://somesite.com",
"mywindow","location=1,status=1,scrollbars=1,
width=100,height=100");
mywindow.moveTo(0,0);
}
</script>
<input type='button' value='popup' onClick="mypopup()"; />


any ideas?

thanks in advance for your time!
-Ken

Bill Posters
01-24-2006, 05:40 PM
Try:

function mypopup() {

var mywindow = window.open('http://www.somesite.com','mywindow','location=1,status=1,scrollbars=1,top=0,left=0,width=100,height=100');

}

i.e. no gaps between the window features (just commas).

(I also positioned the popup using the top and left features rather than create it and move it.)

angst
01-24-2006, 05:47 PM
kool,
just one more question,
how do I pass the url to the function



<script>
function mypopup(url) {

var mywindow = window.open('+url+','mywindow','location=0,status=0,scrollbars=0,top=0,left=0,width=400,height=400') ;

}
</script>
<input type='button' value='popup' onClick="mypopup("http://www.google.com")"; />


thanks again,
-Ken



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum