Results 1 to 4 of 4

Thread: setting window title

  1. #1
    Join Date
    Aug 2005
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default setting window title

    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.

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Because a PDF doesn't have HTML in it. You can't insert HTML.
    Try:
    Code:
    var win=window.open("file.pdf");
    win.document.title = "Title Here";
    ... but I don't think it'll work.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Aug 2005
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Yes it did not work.Anyway thanks for trying out.please let me know if there is any other way around

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    There isn't.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •