how to show window title using window.open()?

user811433 picture user811433 · Nov 8, 2011 · Viewed 90.4k times · Source

I want to open a new window using:

window.open('<myfile>.pdf','my window','resizable,scrollbars');

The new window opens, but I do not get the title of the window as 'my window'. What could be going wrong?

Answer

Muhammad Shoaib picture Muhammad Shoaib · Nov 8, 2011

If domain is same then you can change the title of new window

 <script type="text/javascript">
    var w = window.open('http://localhost:4885/UMS2/Default.aspx');
    w.document.title = 'testing';
 </script>