www.webOShelp.net

Get the latest on:webOS Developers' RSS FeedwebOS Facebook page webOS Twitter Feed

Home Resources API Reference Mojo.requireElement(expectedElement, message, messageProperties)

Mojo.requireElement(expectedElement, message, messageProperties)

Writes an error to the log and throws an exception if expectedElement fails the Prototype isElement method. Returns String containing the error message written to the log.

Parameter Type Description
expectedElement Object Object to be checked to be a element.
message String Custom message to use if the assertion fails. Message will be run through template evaluation against messageProperties so you can include details of the assertion failure in the message.
messageProperties Object Object containing values to use with template evaluation.

Example usage:

Mojo.View.makeFocusable = function(targetElement) {
    Mojo.requireElement(targetElement, "Mojo.View.makeFocusable requires an element.");
    targetElement.setAttribute("tabindex", "0");
};
 

0 Comments

    Add Comment


      • >:o
      • :-[
      • :'(
      • :-(
      • :-D
      • :-*
      • :-)
      • :P
      • :\
      • 8-)
      • ;-)