Friday, February 4, 2011

Show Preview In New Browser Tab Gracefully

I appreciate the preview button feature of the edit html section of this blog-publishing service that first time opens the preview of your blog in a new browser tab(window) and further just refresh it in the same tab. Very handy.
And I was curious how to implement such behavior in my application. I have found that it is very easy.

Usually for the target attribute the _blank value is used. It opens a new tab each time because actually it is a name of the new window. So rather than giving this default value, give a particular name like preview-tab. Then all the clicks should open the content in same window.

No comments:

Post a Comment