View Full Version : Setting the page title of Chrome window.open

Feb 14th, 2011, 04:56 PM
Hi, I have some JavaScript that is being used to open a new window and display a PDF file. This is working fine apart from the title of the new window being open. I am using the window.open function and I have set the title of the page 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'

<a href="javascript:openNewWindow();">Click Here</a>

<script type="text/javascript">
function openNewWindow()
var pdfWindow = window.open('', "window",

pdfWindow.document.write('<html><head><title>Window Title</title></head>');

.write('<body><iframe src="" id="ifrm" name="ifrm" width="100%" height="100%"></iframe>');



Note: I have also tried adding - pdfWindow.document.title="Title"; - to the JavaScript, with no luck.

Is there anything specific that is required for Chrome or am I just missing something??

Thanks in advance for any help!

Feb 15th, 2011, 10:26 AM
I found the solution - just encase anyone else has the same problem...

'about:blank' needs to be added as the first parameter of the window.open function:

window.open('about:blank', "window",