All Products
Search
Document Center

Mobile Platform as a Service:Show title loading

Last Updated:Jan 27, 2026

You can use this API to display a loading indicator in the title bar.

The showTitleLoading Method

AlipayJSBridge.call('showTitleLoading');

Code example

Show or hide the global loading indicator:

<h1>Click the buttons below to see the effect</h1>
<a href="javascript:void(0)" class="btn show">Show loading</a>
<a href="javascript:void(0)" class="btn hide">Hide loading</a>

<script>
function ready(callback) {
  // If AlipayJSBridge is injected, call the callback directly.
  if (window.AlipayJSBridge) {
    callback && callback();
  } else {
    // If AlipayJSBridge is not injected, listen for the AlipayJSBridgeReady event.
    document.addEventListener('AlipayJSBridgeReady', callback, false);
  }
}
ready(function() {
  document.querySelector('.show').addEventListener('click', function() {
    AlipayJSBridge.call('showTitleLoading');
  });

  document.querySelector('.hide').addEventListener('click', function() {
    AlipayJSBridge.call('hideTitleLoading');
  });
});
</script>