JqGet Method (Client)


PLB Web Only, 9.9

 

The JqGet method retrieves low level HTML element properties, css styles, values, text, or HTML contents from the client browser. The method gets the request data from the first HTML element of a set of elements matching selector criteria. The method uses the following format:

 

[label]

{object}.JqGet

[GIVING {return}] USING [*Selector=]{selector}:

 

 

[*Name=]{name}[,[*Flags=]{flags}

 

Where:

label

Optional. A Program Execution Label.

object

Required. A CLIENT object that has been declared.

return

Optional. A Character String Variable that returns a string from a HTML element depending on the {name} data type.

selector

Required. A Character String Variable or literal that contains HTML element selection criteria.

name

Required. A Character String Variable or string literal that identifies the type of data to be retrieved from the HTML element.

flags
Optional. a Numeric Variable or decimal number that specifies a bit mask value that controls the behavior of this method.

Flags Affected: EOS

Note the following:

  1. This is an advanced method that is required only when custom coding is performed using the JQuery framework.

  2. The EOS flag is set if the returned data string is larger than the DIM variable used to receive the data.

  3. The {selector} is a filter that determines a set of HTML elements for data retrieval. The {selector} string is sent to the jQuery API exactly as received from the PLB program variable. See this link for more information about the {selector} criteria:

  4.  

    http://api.jquery.com/category/selectors/

     

  5. The {name} identifies the type of data retrieved from the set of HTML elements matching the {selector} criteria. Depending on the {name} data type being retrieved, the data may come from the first HTML element in the set of elements or the returned data may be retrieved from all of the HTML elements in the element set. This element data access behavior can be determined from jQuery API documentation links found at:

  6.  

    http://api.jquery.com

     

    The {name} parameter can be a pre-defined special name or it can be an HTML attribute, css, or property name for the HTML element being accessed.

     

    The pre-defined special name and the HTML attribute names are only returned when the current {flags} value is set to zero (0).

     

    Special

    Comment

    More information ...

    Html

    Html Contents

    http://api.jquery.com/html/

    Text

    Text all elements

    http://api.jquery.com/text/

    Val

    Current value

    http://api.jquery.com/val/

    {attr

    A valid jQuery attribute name

    http://api.jquery.com/attr/

     

    If the {flags} is set to access CSS styles (value 0x0001) or to access HTML element properties (value 0x0002), the {name} gives the specific CSS or property name to retrieve.

     

    Css/Prop

    Comment

    More information ...

    {cssname}

    A valid css name for the HTML element

    http://api.jquery.com/css/

    {propname}

    A valid jQuery property name

    http://api.jquery.com/prop

     

  7. The {options} parameter is a bitmask value the forces specialized behaviors for the execution of this method. The bitmask values are defined as follows:

  8.  

    Option

    Value

    Meaning ...

    $JQ_FLAG_CSS

    1

    When this bit is set, the {name} must be set to a valid CSS style name for the HTML element being accessed. See this URL: http://api.jquery.com/css/

    $JQ_FLAG_PROP

    2

    When this bit is set, the {name} must be set to a valid property name for the HTML element being accessed. See this URL: http://api.jquery.com/prop/

     

  9. The {return} string depends on the {name} data type being requested.

Example:

 

    Client.JqGet Giving GetCss Using "##radio input:checked ~ label","color", $JQ_FLAG_CSS

 

In this example, the CSS style named "color" is retrieved from the first radio button checked.

 

The GetCss variable returns a string as follows:

 

rgb(255, 0, 0)

 

 

See Also: CLIENT, Client Methods, Method Syntax

 



PL/B Language Reference JsMakeString Method (CLIENT) JsRun Method (CLIENT)