Skip to content
galen edited this page Dec 21, 2015 · 4 revisions

Web compatible API

  • alert

    alert('message');
  • confirm

    var b = confirm('message')
    alert(b);
  • href

    <a href="http://www.wequick.net">wequick</a>

Native bridge API

Small.invoke(method, params, callback);

Internal bridge API

  • alert

    Small.invoke('alert', {
      title: 'title',
      message: 'message', 
      ok: 'OK'
    }, null);
  • confirm

    Small.invoke('confirm', {
      title: 'title',
      message: 'message', 
      buttons: ['OK', 'Cancel']
    }, function(i) {
      alert('Clicked button at index: ' + i);
    });
  • toast

    Small.invoke('toast', {
      message: 'message',
      delay: 1 // unit: second, support 1 or 3, default as 1.
    });
  • hud

    Small.invoke('hud', {
      action: 'show',
      message: 'message'
    });
    
    Small.invoke('hud', {
      action: 'hide',
      delay: 1 // unit: second, support 1 or 3, default as 1.
    });

Custom bridge API