---
title: "Basic methods for opening popup window in javascript?"  
description: "Basic methods for opening popup window in javascript?"  
author: "Amit Singh"  
published: 2011-03-18  
updated: 2020-09-21  
canonical: https://www.mindstick.com/interview/542/basic-methods-for-opening-popup-window-in-javascript  
category: "javascript"  
tags: ["javascript"]  
reading_time: 1 minute  

---

# Basic methods for opening popup window in javascript?

There are two basic way to open new window\
1) Using Window.Open() and \
2) Using Window.showModalDialog() \
\
The Syntax for using these methods are \
\
**.** Window.Open(URL,WindowName,Window Features) \
\
Example:\

```
window.open ("http://www.dotnetfunda.com","mywindow","status=1,toolbar=1");
```

\
**.** window.showModalDialog(URL,WindowName,ModalDialog Features)\
for example:\

```
window.showModalDialog("http://www.mindstick.com", "mywindow","dialogWidth:400px;dialogHeight:395px");
```

## Answers

### Answer by Amit Singh

There are two basic way to open new window\
1) Using Window.Open() and \
2) Using Window.showModalDialog() \
\
The Syntax for using these methods are \
\
**.** Window.Open(URL,WindowName,Window Features) \
\
Example:\

```
window.open ("http://www.dotnetfunda.com","mywindow","status=1,toolbar=1");
```

\
**.** window.showModalDialog(URL,WindowName,ModalDialog Features)\
for example:\

```
window.showModalDialog("http://www.mindstick.com", "mywindow","dialogWidth:400px;dialogHeight:395px");
```


---

Original Source: https://www.mindstick.com/interview/542/basic-methods-for-opening-popup-window-in-javascript

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
