Fabian said:
Lots of people say that
a link (ie href="") should only ever point to another web page, not a
javascript.
I concur. The typical behavior associated to a link is fetching the
resource that the link points to. Typical labels of links are nouns
or descriptions: "Cats", "Movies", "My links", "Rocket Science".
a form button should only ever point to a server executable or a post
method
I disagree. Form controls can exist without a form, e.g., in DHTML
applications. The behavior associated with a button is that clicking
it makes something happen. Typical labels on buttons are verbs or
actions: "Go!" "Activate", "Close window", "Energize".
A good sign that using a link is misuse is that you don't know what
to write in the href. Without a href, an <a>-element is no more special
than a <span>. Adding, e.g., href="#" (a href that is never used anyway)
is only to change how the element *looks*, which is really something one
should do with CSS, not HTML.
So what is a mutually acceptable trigger for something to activate a
javascript?
Unless the Javascript fetches a resource (you can write javascript
that emulates a link perfectly), probably a button. Consider what
you would write in the link/on the button.
Or should we just ignore all those people trying to impose
their own style on things?
At your own peril. These rules describe what usability experts have
found that people typically expect. Going against the users'
expectations is rarely a smart move. It just makes the vote with their
feet^H^H^H^Hback button.
/L