x
 
1
<!DOCTYPE html>
2
<title>My Example</title>
3
4
<script>
5
// Wait for DOM to load
6
document.addEventListener("DOMContentLoaded", function(event) {
7
8
  // Put the button into a variable
9
  var e = document.getElementById("go");
10
  
11
  // Wait for user to click the button
12
  e.addEventListener("click", function() {
13
    
14
    // Get the URL from the user input
15
    var url = document.getElementById("url").value;
16
    
17
    // Do the popup window
18
    window.open(url,"popUpWindow","height=500, width=400, left=100, top=100, resizable=yes, scrollbars=yes, toolbar=yes, menubar=no, location=no, directories=no, status=yes");
19
    
20
  }, false);
21
  
22
});
23
</script>
24
25
<!-- Replace '{action page}' with your own action page to support non-JavaScript users -->
26
<form name="popupForm" action="{action page}">
27
  <input name="url"  id="url" value="/javascript/examples/sample_popup.cfm">
28
  <input name="go" id="go" type="button" value="Go">
29
</form>