behavior:hyperlink

behavior:hyperlink

Standard hyperlink behavior. It can be applied to any DOM element having href attribute defined.

Elements

These elements have behavior:button applied by default:

  • <a href="url">...</a>

Attributes

This behavior knows about:

  • href="url" – hyperlink url;
  • target="ID" – ID of frame element where to load the URL content.

Events

Other than standard set of events (mouse, keyboard, focus) behavior:button generates:

  • HYPERLINK_CLICK event, generated on mouse down/up or spacebar key press events when button is in focus. Posted (asynchronous) event.

If this is event is not consumed by user’s code then nearest document will handle URL loading.

Methods

N/A – behavior:button does not introduce any specific methods.

Value

N/A.

Hyperlink click handling in script

raw onClick handler

var btn = $(a#some);
btn.onClick = function() { event handling code ...; 
                           return true; /*consume the event*/ }

on() subscription

var btn = $(a#some);
btn.on("click", function() { ... event handling code ... });
self.on("click", "button#some", function() { ... event handling code ... });

decorators.tis handler

include "decorators.tis";
@click @on "a#some" :: ... event handling code ...;