究竟是什么HTML5<命令>标记和浏览器支持 [英] What exactly is the HTML5 <command> tag and what is the browser support

查看:163
本文介绍了究竟是什么HTML5<命令>标记和浏览器支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已阅读 HTML5规范< < command> ,并发现此元素上的信息非常含糊。 $ b

我已经尝试过了,发现它在Chrome(最新版本)中不是,而且在Safari(甚至更老的)上工作,抱歉没有FF(不要拍摄我请) - Mac只测试。



我不能了解这个元素的用途,或者即使我正确使用它。



我事先感谢您对此进行任何澄清!

解决方案

它可以在Windows 3.6.13上使用。



是为了封装你可以做的事情。它可以在一个菜单中呈现(因为一个菜单提供了你可以调用的项目)。



这个想法



它在UI和命令之间提供了一个抽象层,以便您可以使多个UI元素引用相同的命令。这为您提供了一个灵活的功能,即在菜单中呈现一个命令元素,该元素也通过页面中间的URL以及页面底部的按钮进行调用。禁用该命令会禁用所有访问路径(url / button / menu)到命令后面的操作。



我们在哪里 - 截至2010年1月26日



目前关于如何将其链接到多个元素实际上可以工作的信息非常稀少(因为浏览器刚刚开始实现它) / b>,但这是它的意图之一。

目前唯一记录的用法是提供一个语义上唯一的标签来指定(不使用< input> <按钮> 元素)它是命令< menu> 中,从而允许浏览器进行真实菜单呈现(实施时)。


I've read the HTML5 spec for <command> and found the information on this element very vague.

I've tried it out and found that it is not working in Chrome (latest version) and it is working on Safari (even older ones), sorry no FF (don't shoot me please) - Mac only test.

I can't understand what is the use of this element or even if I'm using it correctly.

I thank you in advance for any clarification about it!

解决方案

It works on Firefox 3.6.13 from Windows by the way.

The command element is meant to encapsulate something that you can do. It can be rendered within a menu (since a menu presents items you can invoke).

The idea

It provides an abstraction layer between UI and commands, so that you can make multiple UI elements refer to the same command. This gives you the flexibility of having one command element, rendered in a menu, that is also invoked via a URL in the middle of the page as well as a button at the bottom of the page. Disabling the command disables all access paths (url/button/menu) to the action behind the command.

Where we are at - as of 26 Jan 2010

There is currently very scarce information as to how linking it to multiple elements will actually work (since browsers have only just started implementing it!) but that is one of its intentions.

At the present moment, the only documented usage is to provide a semantically unique tag to specify (without using <input> or <button> elements) that it is a command within a <menu>, thereby allowing "real" menu rendering by the browser (when implemented).

这篇关于究竟是什么HTML5&lt;命令&gt;标记和浏览器支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆