Improve company productivity with a Business Account.Sign Up

x
?
Solved

<a href>  --> new window

Posted on 2006-11-30
11
Medium Priority
?
659 Views
Last Modified: 2012-06-21
Hi Friend

I question how to open a document in a new windown when clicked on hiper link.

example <A HREF="http://loaclhost/abc/process.doc" target="_blank">click here</a>

this shiuld open in a new window. But I have a problem.
when I click the link it is giving popup to open or save.
I dont want to get open or save. I want Word Document to open in new browser window.

How can I do that. what functionality I need to add.

If possible please change the example code and help me out.

Thanks
0
Comment
Question by:basirana
11 Comments
 
LVL 19

Expert Comment

by:VoteyDisciple
ID: 18048313
That's up to the browser.  My browser, for instance, will never display a Word document inline; it will always ask me to save or open it.  Even working in an MSIE-only environment, I recommend against relying on behavior that opens Word documents inline.
0
 

Author Comment

by:basirana
ID: 18048409
Bcoz I have seen docs openning in the web browser. How can we do that.
0
 
LVL 19

Assisted Solution

by:VoteyDisciple
VoteyDisciple earned 300 total points
ID: 18048513
This Microsoft KB article ( http://support.microsoft.com/kb/162059 ) describes how to UNDO what you want, but that's also enough information to be able to do it.

Basically:
* From Windows Explorer (i.e. any folder on your computer) Click Tools > Folder Options
* Click the "File Types" tab.
* Find "DOC" in the list of file types, and click the "Advanced" button down at the bottom
* Check the "Browse in Same Window" box.
0
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

 
LVL 19

Expert Comment

by:VoteyDisciple
ID: 18048526
I should add: I do not personally know of an extension that will allow this for Firefox, Opera, et cetera, though it's entirely possible someone has crafted one.

Most people want the opposite behavior (getting files to open in the appropriate program instead of in the browser), so the trend in available information is gonna be away from what you're trying to do.
0
 

Author Comment

by:basirana
ID: 18048549
Thats true... but the business requirement is I need to open in new browser window. insted of open or save.
is there anyway we can do it in javascript.

Thanks
0
 
LVL 19

Expert Comment

by:VoteyDisciple
ID: 18048564
That's what the target="_blank" does.

The Windows option saying "same window" is just Microsoft talking about the browser window vs. the application window.
0
 

Author Comment

by:basirana
ID: 18048613
I found a sample code. that say target="_blank"
0
 
LVL 10

Assisted Solution

by:Dennis Maeder
Dennis Maeder earned 600 total points
ID: 18049371
Is this what you want? A mime content-type declaration.
<A HREF="http://loaclhost/abc/process.doc" target="_blank" type='application/msword'>click here</a>
See
http://www.w3.org/TR/html4/types.html#type-content-type
and
http://support.microsoft.com/kb/184335

D
0
 
LVL 19

Accepted Solution

by:
DreamMaster earned 600 total points
ID: 18052186
Hi basirana,

You cannot control what the browser of another person will react like to your document. Some people will have the option turned off to open known document types in a browser window, although by default this is turned on in Internet Explorer. So there's really not that much you can do about it. The way you do it right now, using a target="_blank", is the proper way to open a Word document in the browser with the default options of Internet Explorer. If a user changed his/her settings, you cannot change that back for them.

Regards,
Max.
0
 
LVL 13

Expert Comment

by:jmundsack
ID: 18075874
If you absolutely cannot contend with the open/save prompt, then one option could be to have a script running on the server that will output a Word document as HTML, and display the HTML instead.  Of course this would assume that you only wanted the document presented for reading, not for editing.  If you need them to open the document for editing in Word, there really is no way around that prompt, AFAIK.
0
 
LVL 2

Expert Comment

by:score_under
ID: 18080437
Create a second html page with source:

<embed src="http://localhost/abc/process.doc" width="100%" height="100%"></embed>

Be aware that this will only work in internet explorer on windows with ms office installed.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
There's never been a better time to become a computer scientist. Employment growth in the field is expected to reach 22% overall by 2020, and if you want to get in on the action, it’s a good idea to think about at least minoring in computer science …
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

606 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