PDA

View Full Version : setting window title



rama1977
08-25-2005, 06:57 PM
Hi ,

When i click on a hyperlink it opens a new window,basically i open a PDF document.I am trying to set the window title but it is not getting set.Thne i found that if i open a HTML file then the window title gets set by the following code

<html>
<head>
<script language="javascript">

function callwin()
{
var win = window.open("event.html","mywindow","")
win.document.write('<html><head><title>window</title></head</HTML>');
}

</script>

</head>
<body>
<a href="#" onClick="javascript:callwin()">ClickHere</a>
</body>
</html>

But instead of a html file if i give a pdf doc like this

var win = window.open("manual.pdf","mywindow","")

it opens the doc but does not set the title of the window.

How to correct this problem.Any help will be appreciated.Thanks.

Twey
08-25-2005, 07:16 PM
Because a PDF doesn't have HTML in it. You can't insert HTML.
Try:

var win=window.open("file.pdf");
win.document.title = "Title Here";
... but I don't think it'll work.

rama1977
08-25-2005, 07:29 PM
Yes it did not work.Anyway thanks for trying out.please let me know if there is any other way around

Twey
08-25-2005, 07:37 PM
There isn't.