Categories > Logic > rex_jsshell

Introduction

Invoke javascript function.

Links


Categories > Logic > rex_jsshellIntroductionLinksDependenceUsageInvoke function by actionsInvoke function by expressionCreate instanceMore examples

Dependence

None

Usage

Invoke function by actions

Invoke javascript function
Load javascript
Action:Add callback
Action:Add C2 function callback
Action:Set function name
Add parameters
----
Action:Add value
Action:Add boolean
Action:Add null
Action:Add JSON
Action:Add callback
Action:Add C2 function callback
Action:Add object
Action:Invoke
Return value
----
Expression:ReturnValue
Expression:Prop
Condition:Callback
Expression:Param
Official function object
----
Condition:On function
Expression:Param
Action:Load API
Action:Execute Javascript
(Official browser plugin)

  1. Load javascript

    • Action:Load API (Sample capx)
    • Official Ajax plugin: Action: Request project file
    • Official browser plugin: Action:Execute Javascript (Sample capx)
  2. Action:Set function name

  3. Add parameters

    • Action:Add value
    • Action:Add boolean
    • Action:Add null
    • Action:Add JSON
    • Action:Add callback
    • Action:Add C2 function callback
    • Action:Add object
  4. Action:Invoke

    • Return value

      • Expression:ReturnValue
      • Expression:ReturnValue(key), to get property of return value
      • Expression:ReturnValue(key, defaultValue)
      • Expression:Prop(key)
    • Store return object to variable (Sample capx)

      • Expression:Prop(key)
      • Expression:Prop(key, defaultValue)
  5. Callback

    • Condition:Callback, from callback parameter (Action:Add callback)

      • Expression:Param(n), to get nth parameter of callback
      • Expression:Param(n, key), to get property of nth parameter of callback
      • Expression:Param(n, key, defaultValue)
    • Condition:On function of official function object, from C2 function callback (Action:Add C2 function callback) (Sample capx)

      • Expression:Param(n), to get nth parameter of callback

Invoke function by expression

Sample capx

Create instance

Action:Set object type
Add parameters
----
Action:Add value
Action:Add boolean
Action:Add null
Action:Add JSON
Action:Add callback
Add C2 function callback
Action:Add object
Action:New instance
Expression:Prop

Sample capx

  1. Action:Set object type

  2. Add parameters

    • Action:Add value
    • Action:Add boolean
    • Action:Add null
    • Action:Add JSON
    • Action:Add callback
    • Action:Add C2 function callback
    • Action:Add object
  3. Action:New instance

    • Expression:Prop(key)
    • Expression:Prop(key, defaultValue)

More examples