Friday, October 12, 2007

target = "_self" problem

I tried writing an HTML today to open a Word document in the same browser window. And as usual found something worth logging.

The file was not opening in the same browser even though target attribute of the anchor tag was set to _self. Then, I tried to use iframe to view the document in a smaller portion/area with in the page but again in vain. The word file was always opening in MS Word.

So, I thought it may be something related to the Windows settings and voila!!! I was right. I needed to change the settings in, Windows Explorer -> Tools -> Folder Options -> File Types for DOC extension. There, for DOC extension I checked the Advanced settings and found that "Browse in same window" option was unchecked. That is what was causing trouble. This setting was making the file to always open in MS Word and so I checked the option and everything was hunky-dory then.

Lesson learnt, don't assume(even because of ignorance) the way a user's machine would be configured while designing a web page.

No comments: