# Javascript pop up help(fix bug)

**URL:** <https://forum.kirupa.com/t/javascript-pop-up-help-fix-bug/261168>\
**Category:** Uncategorized\
**Created:** [May 23, 2008, 6:41pm UTC](https://forum.kirupa.com/t/javascript-pop-up-help-fix-bug/261168 "2008-05-23T18:41:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nnnswordfish](https://avatars.discourse-cdn.com/v4/letter/n/65b543/32.png) [@nnnswordfish](https://forum.kirupa.com/u/nnnswordfish)\
**Post date:** [May 23, 2008, 6:41pm UTC](https://forum.kirupa.com/t/javascript-pop-up-help-fix-bug/261168/1 "2008-05-23T18:41:39Z")

</div>

hy 🙂 here is my as

```auto
on (release) {
getURL ("javascript:NewWindow=window.open('mapservice.html','newWin','width=600,height=600,left=0,top=0,toolbar=No,location=No,scrollbars=No,status=No,resizable=Yes,fullscreen=No'); NewWindow.focus(); screen_height = window.screen.availHeight; screen_width = window.screen.availWidth; left_point = parseInt(screen_width/2)-(800/2); top_point = parseInt(screen_height/2)-(600/2); setTimeout('NewWindow.moveTo(left_point,top_point)',100); void(0);");
}

```

but when i press on button first time window opened in left top corner and then it goes in centre,but i want when i press on button it to open in centre.can any one helps me to fix my as? thanks :bounce:
