The above suggestion should work in most cases.
Beware of using pop-ups at all; they may be blocked by the browser, or the visitor may have determined that their browser opens new bookmark windows instead, causing unexpected results (especially if their tabs open in the background).
Depending on your purpose, you can use jQuery dialog () instead .
source
share