Web UI component: j-Message


  • Info
  • HTML
  • JS
  • CSS
  • Meta

j-Message

  • singleton
  • easy usage

Configuration:

  • button {String} a button label (default: OK)
  • style {Number} can change a style (default: 1), style 2 is similiar to j-Approve component

Usage:

SETTER('message/warning', 'Some warning');
SETTER('message/success', 'Some success message');
SETTER('message/info', 'Some info message');

Works with ASETTER:

  • errors are handled automatically
// Without callback
AJAX('POST /api/profile/', userprofile, ASETTER('message', 'response', 'Profile has been saved successfully'));

// Or with a callback
AJAX('POST /api/profile/', userprofile, ASETTER('message', 'response', 'Profile has been saved successfully', function(response) {
    console.log(response);
}));

// Or with a callback and without message
AJAX('POST /api/profile/', userprofile, ASETTER('message', 'response', function(response) {
    console.log(response);
}));

Author