Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Main window</title>
- <script type="text/javascript">
- var popupwindow = '';
- function popupSelectItem(url) {
- if (!popupwindow.closed && popupwindow.location) {
- popupwindow.location.href = url;
- }
- else {
- popupwindow=window.open(url, 'name', 'height=200,width=150');
- if (!popupwindow.opener) {
- popupwindow.opener = self;
- }
- }
- if (window.focus) {
- popupwindow.focus();
- }
- return false;
- }
- </script>
- </head>
- <body>
- <form>
- Selected item:
- <input id="selectedItem" type="text">
- <input type="button" value="Choose an item" onclick="popupSelectItem('popup.html')">
- </form>
- </body>
- </html>
Add Comment
Please, Sign In to add comment