how do I do
but have it open in new browser window (like with target="_blank", not window.open)
I'm pretty sure target='_blank' is deprecated.
window.open() is the way it is supposed to be done.
target="_blank" is not deprecated (I think... I mean it validates with transitional doctype if you set it in conventional way in <a> tag.. )
but prob is, for window.open you HAVE to set dimensions and all that other stuff... I guess I could say make it same dimensions as current window.. oh brother...
besides which, with window.open() you have issue of pop-up blockers...
deprecated means it is intended to not support it in the future. It doesn't mean it isn't supported now, and there is a reason why it might validate in transitional and not Strict
The red bit is just simply not true at all :lol:
It means that it is intended to be dropped completely from the next version. The purpose of deprecating something is so that people have time to go through all of the spots where they currently use the deprecated code and change it before the next version comes out.
The purpose of transitional doctypes is to allow people to transition from one version to the next. The HTML 4 transitional doctype provides a way for web pages using HTML 3.2 to start using the any new HTML 4 tags while gradually getting rid of all the HTML 3.2 tags that have been deprecated. The problem is that people are creating new web pages using the transitional doctype which was not what it was created for. New pages should be created using the HTML 4 strict doctype as there is no reason whatever for using tags that were flagged in 1997 as being obsolete and to be removed from the next version.
Unfortunately those creating HTML 5 have decided to riscind the 1997 decision to remove the unnecessary garbage tags.
As for target="_blank" - the reason it was flagged for removal from HTML back in 1997 is that it reduces your visitors options as to where the link should open. Without that attribute your visitor can choose whether they want the page to open in the same window, a new window, or a new tab simply by right clicking on the link and selecting one of the three options. Adding that attribute removes one of the three choices while still not giving the web page author any control over which of the other two options will be applied meaning that neither party has control over where the window opens any more.
and this is it:
thank you all for your responses.. in the end just set href attr in jQuery and kept target=_"blank" in <a> tag... a very obvious solution suggested by a colleague.. I can't believe I hadn't thought of it myself...
thank you very much..
PS: pls also note that links included in posts like this right here in Sitepoint fora also open in a new window....;~)
Of course as the professional you should be advising them that it will make their page less usable and drive away visitors. You should then do it on the basis that they are trying to drive some of their visitors to their competition.
Of course the more knowledgeable visitors will have turned off the target attribute in their browser so that it will not do anything anyway.