1<html> 2<head> 3<title>Test Title</title> 4<script type="text/javascript"> 5function OpenPopup() { 6 // Create a new popup window 7 var oWnd = window.open('','MyPopupName','width=350,height=300',false); 8 9 // Dynamically generate the HTML content for popup window 10 var sHtml = 11 '<html>' 12 + '<head><title>My Popup Title</title></head>' 13 + '<body>' 14 + '<script type="text/javascript">' 15 + 'document.title="My Dynamic Title";' 16 + '<\/script>' 17 + '</body>' 18 + '</html>'; 19 20 // Push the HTML into that window 21 oWnd.document.write(sHtml); 22 23 // Finish 24 oWnd.document.close(); 25} 26</script> 27</head> 28<body> 29 <p>This is dynamic2.html</p> 30</body> 31</html> 32