OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <title>window open</title> | 3 <title>window open</title> |
4 <script type="text/javascript"> | 4 <script type="text/javascript"> |
5 var new_window; | 5 var new_window; |
6 | 6 |
7 function OnClick() { | 7 function OnClick() { |
8 // Open popup to the url from the given query string. | 8 // Open popup to the url from the given query string. |
9 var url = window.location.search.substring(1); | 9 var url = window.location.search.substring(1); |
10 new_window = window.open(url, "_blank", | 10 if (!new_window) { |
11 "left=10, top=10, height=250, width=250"); | 11 new_window = window.open(url, "_blank", |
| 12 "left=10, top=10, height=250, width=250"); |
| 13 } |
12 } | 14 } |
13 | 15 |
14 function OnKeyPress() { | 16 function OnKeyPress() { |
15 var char_code = String.fromCharCode(event.keyCode); | 17 var char_code = String.fromCharCode(event.keyCode); |
16 if (char_code == 'c') { | 18 if (char_code == 'c') { |
17 new_window.close(); | 19 new_window.close(); |
18 } | 20 } |
19 } | 21 } |
20 </script> | 22 </script> |
21 </head> | 23 </head> |
22 <body onkeypress="OnKeyPress();" onclick="OnClick();"> | 24 <body onkeypress="OnKeyPress();" onclick="OnClick();"> |
23 ChromeFrame full tab mode window open popup test | 25 ChromeFrame full tab mode window open popup test |
24 </body> | 26 </body> |
25 </html> | 27 </html> |
OLD | NEW |