HELP!

onceAsync

One time call for asynchronous operations. See more about The side effects of the Replay Stack

xpertrule.onceAsync(function(completeCB) { /* your code goes here */ completeCB(myResult); });
  • "function" JavaScript code to execute once.
  • "myResult" result of asynchronous operation handled by call back.

For example...

var myResult = xpertrule.onceAsync(function(completeCB) {
    $.ajax({
      url: "http://acme.inc/service",
      type: "POST",
      data: {
        recordID: 42
      },
      dataType: "json",
      success: function(d) {
        completeCB(d);
      },
      error: function(e) {
        completeCB(false);
      },
      timeout: 10000
    });
});

On This Page