В то время как цель = "_ пробел" удерживается от использования, почему блок проверки допустимости W3C не дает ошибку об этом? Можно вставить и проверить этот интервал кода блок проверки допустимости:
Untitled Document
Править:
Это означает, что цель поддержек XHTML 1.1 =” _blank”, но строгий XHTML 1.0 не делает? Или действительно ли это - ошибка в блоке проверки допустимости W3C?
You are being validated as XHTML Transitional rather than Strict. If you manually override the doctype to XHTML 1.0 Strict you get this error:
Error Line 11, Column 76: Attribute "target" exists, but can not be used for this element.
…om" title="New window will open" target="_blank">Link opens in new window
Use this doctype if you want to be strict:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
The transitional schemas still allow certain deprecated elements and attributes, I guess to help people transition in steps towards a stricter markup.
EDIT:
OK, so the original code was XHTML 1.1 of which there is just one single version (no Strict/Transitional), and according this FAQ the target attribute is indeed not allowed. So I guess this must be a bug in the validator.
It is deprecated but not removed. That's why i think there is problem in validating that.
The XHTML1.1 documentation shows that the target attribute of an a
element can be "anything".
Означает ли это, что XHTML 1.1 поддерживает target = ”_ blank”, но не строгий XHTML 1.0?
Ну, да.
Если вам нужен обходной путь для вашей проблемы, то этот их. Другой вариант - использовать window.open () вместо target = "_ blank".
Хотя xhtml может поддерживать targrt = "_ blank", он НЕ БУДЕТ проверять его, потому что он был обесценен. Если вы не хотите использовать JS, вам придется использовать переходный вместо строгого в своем "типе документа". .