Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to Set the Browser Title for non-HTML Document?

Posted on 2003-11-25
11
Medium Priority
?
357 Views
Last Modified: 2012-08-13
Is there are a way to set the browser title when putting a non-HTML document (e.g. a PDF or XML doc) in a browser?

The best I can tell, this was at one time possible with an HTTP header but is no longer supported.  I know I can do this by putting the non-HTML document in a frame and putting a title on the enclosing frameset, but this seems rather clunky.

Thanks in advance,

Marc
0
Comment
Question by:marc_rabil
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
11 Comments
 
LVL 31

Accepted Solution

by:
seanpowell earned 375 total points
ID: 9818044
Here's one solution:

<html>
<head>
<title>My PDF File</title>
<style type="text/css">
<!--
body { margin:0px; padding:0px; overflow:hidden; }
//-->
</style>
</head>
<body>
<embed src="myfile.pdf" width="100%" height="100%">
</body>
</html>
0
 
LVL 7

Expert Comment

by:gam3r_3xtr3m3
ID: 9824023
we know framesets are clunky, but that's the only way to do it.

-gam3r
0
 
LVL 6

Expert Comment

by:jarasa
ID: 9824211
HI
Can you be more explicit on what you want to do?
I mean, you have a PDF and want to show it on a new page, or just any pdf that could be found on the Internet through your page?
regards
Javier
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 31

Expert Comment

by:seanpowell
ID: 9824233
>>we know framesets are clunky, but that's the only way to do it.
Actually, there's a number of ways to do it without framesets - one example is above...
0
 
LVL 15

Expert Comment

by:JakobA
ID: 9829170
<!doctype
0
 

Author Comment

by:marc_rabil
ID: 9830794
jarasa:

We have a web application that puts various document types (eg. PDFs, XML, etc) in a new browser window. Everything works fine, except the new window title is the URL to the document and we want to make it a user friendly name like "Document Window".  The documents are usually not real files but are generated dynamically.  They are served up from our server so we have the opportunity to manipulate the response before the bytes are sent to the window.

Of course, we can first return HTML like a frameset (or an embed tag as suggested by georgemarian) which sets the title and in turns calls the document but I was hoping there was an easier way like to just set an HTTP header or something.

JakobA:

It looks like something is missing from your comment.

Marc
0
 
LVL 6

Expert Comment

by:jarasa
ID: 9830835
Hi Marc.

Try to find a javascript library called ByKlein_chromeless.js it will let you put the Title always no matter what you do and in iExplorer lets you cahnge almost all the GUI from the browser so you can even put a PDF icon or whatever. I said try to find it becose is not easy any more, the home page of this guy does not work any longer, if you're not able to find it let me Know and I'll send it to you some how, I know is not able to put emails here but maybe I'll be able to put it some where on the internet and give you the URL.

regards

Javier
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 9830890
Well at it's simplest level, "title" is a property of the object "document", so it can be easily accessed (except that it's read-only in NN4...)

One way would just be to modify the document title with some simple javascript, either in the head or the body section - although the former is probably preferable

<html>
<head>
<script language="javascript" type="text/javascript">
<!--
document.title = "My PDF Document";
//-->
</script>
</head>
<body>
PDF File outputs here...
</body>
</html>
0
 
LVL 6

Expert Comment

by:jarasa
ID: 9830908
Hi georgemarian.
I think that the problem of marc is that he does not control the output of the PDF becose is gerated dinamically, so he just sent the content to the outputStream and the browser opens it itself.
Javier
 
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 9830942
Hmmm...although he should still be able to control how the new window is generated, no? Or am I missing something...
0
 
LVL 6

Expert Comment

by:jarasa
ID: 9830997
Well if you open the new window with a title and call a servlet wich generates a pdf and opens you a download window when you say open it instead of save as file I think it changes the title and puts the temporal name of it.
I believe I had that problem but solved by unassinnig the PDF from the browser so it always opens the Acrobat and don't display it on the browser. but I think the javascript I said it does not change the title.
Javier
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question