What is the correct way to open a form submit in a new window now target is deprecated

陌路散爱 提交于 2019-12-11 02:35:26

问题


Normally I would us

<form target="_blank">

But looking through

http://www.w3schools.com/tags/tag_form.asp

I notice the target attribute is deprecated.

So what is the correct XHTML compliant way to perform such an action?

UPDATE: Thanks, I appreciate that opening new windows is not generally a good idea but in this case it's a third party linking to our site who wants this effect and unfortunately whilst I can suggest good design to them whether they take my advice is another matter :(


回答1:


The target attribute is not deprecated (W3Schools is wrong again (and not the W3C)), it just doesn't appear in Strict.

If you want a new window from a form, then use the target attribute (and a Transitional doctype).

However, author triggered new windows are considered harmful.



来源:https://stackoverflow.com/questions/2801230/what-is-the-correct-way-to-open-a-form-submit-in-a-new-window-now-target-is-depr

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!