# vim: ts=3 sw=3 et ft=org
#+TITLE: Link Element Element
#+STYLE: <LINK href='../stylesheet.css' rel='stylesheet' type='text/css' />
#+AUTHOR: Rusty Klophaus (@rustyio)
#+OPTIONS:   H:2 num:1 toc:1 \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
#+EMAIL: 
#+TEXT: [[file:../index.org][Getting Started]] | [[file:../api.org][API]] | [[file:../elements.org][*Elements*]] | [[file:../actions.org][Actions]] | [[file:../validators.org][Validators]] | [[file:../handlers.org][Handlers]] | [[file:../config.org][Configuration Options]] | [[file:../about.org][About]]

* Link Element - #link{}

  The link element produces a clickable hyperlink. Depending on its settings,  
  the link can either function as a normal client-side hyperlink, or can
  cause a Nitrogen postback.

** Usage

#+BEGIN_SRC erlang
  #link { text="Example Hyperlink", url="http://nitrogenproject.com" },
#+END_SRC

#+BEGIN_SRC erlang
   #link { text="Example Postback Link", postback=link_clicked }
#+END_SRC

#+BEGIN_SRC erlang
   #link { body=#image { image="path/to/image.gif" }, postback=link_clicked}
#+END_SRC

** Attributes

   + text - (/string/) :: The text to display.

   + body - (/Nitrogen elements/) :: Instead of text, specify one or more Nitrogen elements (such as an #image) to wrap in a link.

   + html\_encode - (/boolean/) :: Set to true to safely html-encode the link's title.

   + url - (/string/) :: If set, clicking on the link will navigate to this URL.

   + new - (/boolean/) :: Set to true to make link open in a new window.

   + postback - (/Erlang term/) :: If set, clicking on the link will cause a Nitrogen postback with the supplied term.

   + mobile_target - (/Boolean/) :: If set to false, this will work with jQuery Mobile to ensure that it skips using jQuery Mobile's automatic page transition loading system.

   + mobile_dialog - (/Boolean/) :: If set to true, this will work with jQuery mobile to load the target URL in a [[http://jquerymobile.com/demos/1.1.1/docs/pages/page-dialogs.html][jQuery Mobile Dialog]].

** See Also

   + [[./base.html][base element]]

   + [[./button.html][button element]]

   + [[../jquery_mobile_integration.html][jQuery Mobile Integration Guide]]
