I have JavaScript that is used to open a new window and display a PDF file. This works great, except that the name of the new window is open. I use the window.open function and I set the page title using the document.write function (see code below). The code works fine for FF and IE, but for some reason Google Chrome just displays "Untitled - Google Chrome"
<body> <a href="javascript:openNewWindow();">Click Here</a> <script type="text/javascript"> function openNewWindow() { var pdfWindow = window.open('', "window", 'resizable=1,scrollbars=0,width=800,height=600'); pdfWindow.document.write('<html><head><title>Window Title</title></head>'); pdfWindow.document .write('<body><iframe src="" id="ifrm" name="ifrm" width="100%" height="100%"></iframe>'); pdfWindow.document.write('</body></html>'); pdfWindow.document.close(); } </script> </body>
Note. I also tried adding - pdfWindow.document.title = "Title"; - in JavaScript, with no luck.
Is there anything specific that is required for Chrome, or am I just missing something?
javascript google-chrome
Will Feb 14 2018-11-11T00: 00Z
source share