Stupid Question 83: What does the HTML5 Command tag do, and is this similar to commands in XAML?
[To celebrate my first year of programming I will ask a ‘stupid’ questions daily on my blog for a year, to make sure I learn at least 365 new things during my second year as a developer]
When working with XAML technologies you have something called ‘Commands’ - basically this is a way to have an action that can be invoked from different sources and in different ways. Often copy, cut and paste are used as perfect command examples. While sharpening my HTML5 skills I came across a new tag I haven’t seen before, the command tag. And my first question was, is this what I think it is? I decided to find out.
It does seem like it is similar - but not quite the same (as the command is defined in the UI, plus it has to be invoked from a menu, buttons and or links), you define a command and tie an action to it, so the command can be invoked from several sources. This gives you an abstraction that allows you to manipulate the command instead of the elements tied to it when you have to (enable/disable).
I was very keen on trying this out, but couldn’t find any browsers that supports this tag :( So we will have to wait….
Edit: Works in IE9 - but not IE10 ??
Leave a comment (via email)
another excellent question Iris. Does command not work in Safari?
Last modified on 2012-11-16