WAnchor [doc]

A WAnchor corresponds to an HTML <a> element, and provides a link to an URL:

Wt homepage (in a new window)

When an anchor is activated, by default the browser will replace the Wt application with the targeted document. This may be changed to suggest the browser to follow the link in a new window, using the setTarget() method.

You may specify the anchor's target URL directly, but anchors can also be pointed to a WResource. This allows you to serve auxiliary files related to a particular application session, and perhaps dynamically generate the content. Wt includes WFileResource to stream a file and WMemoryResource to stream a data vector.

WAnchor also plays an important role for navigation within your application, using Wt's internal paths, since they provide support for bookmarks, the browser back/forward buttons, and following links in new windows. For example, the WMenu widget (used here to navigate Wt widgets) uses anchors for its items by default.

Events will be shown here.