Global

Members

<constant> $_GET :Object.<String, String>

PHP-style associative array (Object) of URL parameters.

This object is created when the page loads and thus contains the URL's query parameters at that time. However, it is possible to change the URL through JavaScript functions such as history.pushState(). If the URL may have changed and you need to the most recent query parameters, use Firebolt's $._GET() function, which also updates the $_GET object when it is called.

Type:
Source:
See:

Methods

$1(string) → {Element}

Returns the first element within the document that matches the specified CSS selector or the element created from the input HTML string.
Basically the same thing as $(), but only dealing with a single element.

Parameters:
Name Type Description
string String

A CSS selector string or an HTML string.

Source:
Throws:
SyntaxError
When the passed in string is not an HTML string (does not start with the "<" character) and is an invalid CSS selector.
Returns:
Type
Element
  • The selected element (or null if no element matched the selector) or the created element.
Example
$1('button.btn-success'); // Returns the first <button> element with the class "btn-success"
$1('<p>content</p>');     // Creates a new <p> element containing the string "content".

$$(id) → {Element}

Returns the first element within the document with the specified ID. Can also be called by the alias $ID().
Alias of document.getElementById().

Parameters:
Name Type Description
id String

A case-sensitive string representing the unique ID of the element being sought.

Source:
Returns:
Type
Element

The element with the specified ID or null if there is no such element in the document.

$CLS(className) → {HTMLCollection}

Returns a list of the elements within the document with the specified class name.
Alias of document.getElementsByClassName().

Parameters:
Name Type Description
className String
Source:
Returns:
Type
HTMLCollection

A set of elements with the specified class name.

$ID(id) → {Element}

Returns the first element within the document with the specified ID. Can also be called by the alias $$().
Alias of document.getElementById().

Parameters:
Name Type Description
id String

A case-sensitive string representing the unique ID of the element being sought.

Source:
Returns:
Type
Element

The element with the specified ID or null if there is no such element in the document.

$NAME(name) → {HTMLCollection|NodeList}

Returns a set of the elements within the document with the specified name attribute.
Alias of document.getElementsByName().

Parameters:
Name Type Description
name String
Source:
Returns:
Type
HTMLCollection | NodeList

A collection of elements with the specified name attribute.

$QS(selector) → {Element}

Returns the first element within the document that matches the specified CSS selector.
Alias of document.querySelector().

Parameters:
Name Type Description
selector String
Source:
Returns:
Type
Element

$QSA(selector) → {NodeList}

Returns all elements within the document that match the specified CSS selector.
Alias of document.querySelectorAll().

Parameters:
Name Type Description
selector String
Source:
Returns:
Type
NodeList

$TAG(tagName) → {HTMLCollection}

Returns a set of the elements within the document with the specified tag name.
Alias of document.getElementsByTagName().

Parameters:
Name Type Description
tagName String
Source:
Returns:
Type
HTMLCollection

A collection of elements with the specified tag name.

Firebolt(string) → {NodeCollection}

Firebolt's multi-use selector function. Can also be referenced by the synonyms FB and $ (if $ has not already been defined).
Parameters:
Name Type Description
string String

A CSS selector string or an HTML string.

Returns a list of the elements either found in the DOM that match the passed in CSS selector or created by passing an HTML string.

Note #1: This function will only consider the input string an HTML string if the first character of the string is the opening tag character ("<"). If you want to parse an HTML string that does not begin with "<", use $.parseHTML());

Note #2: Since Firebolt does not use Sizzle as a CSS selector engine, only standard CSS selectors may be used.

ProTip: When creating a single element, it's a better idea to use the $.elem() function since it maps directly to the native document.createElement() function (making it much faster) and gives you the option to pass in an object of attributes to be set on the newly created element.

Source:
Throws:
SyntaxError
When the passed in string is not an HTML string (does not start with the "<" character) and is an invalid CSS selector.
Returns:
Type
NodeCollection

A NodeCollection of selected elements or newly created elements.

Example
Firebolt('div, span');   // Returns a NodeCollection of all div and span elements
$('button.btn-success'); // Returns a NodeCollection of all button elements with the class "btn-success"
$('<p>content</p><br>'); // Creates DOM nodes and returns them in a NodeCollection ([<p>content</p>, <br>])
$.elem('div');           // Calls Firebolt's method to create a new div element