Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
Allocate an id to the supplied element if it has none already, by a simple scheme resulting in ids

{section}
{column:width=70%}
Allocate an id to the supplied element if it has none already, by a simple scheme resulting in ids "fluid-id-nnnn" where nnnn is an increasing integer.

{code
:javascript|borderStyle=none|bgColor=white}
fluid.allocateSimpleId(element);
{code}
*File name:* {{Fluid.js

Parameters

}}

h2. Parameters

{span:class=borderless-table
}
|*{{element}}*| (Element) The element to place the id on
.

Return Value

Div
class
Wiki Markup
{div:class=api-page
}

h1. fluid.allocateSimpleId(element)
Section
Column
width70%
javascriptjavascript
bgColorwhite
borderStylenone
Span
class

element

Span
classborderless-table

String

representing the id

Column
width5%
Column

See Also

Example

Code Blockjavascriptjavascript
. |
{span}

h2. Return Value
{span:class=borderless-table}
|*String*| representing the id |
{span}

{column}

{column:width=5%}
{column}

{column}
h3. See Also
* [fluid.allocateGuid]
{column}
{section}
----

h3. Example
{code:javascript}
var titleId = fluid.allocateSimpleId(title);
{code}
In this example, the string returned, {{titleId}} will be added as the {{id}} attribute to the {{title}} node.

{div}