This interface is used to display the loading box in the title bar.
Use showTitleLoading interface
AlipayJSBridge.call('showTitleLoading');
Code sample
Show/hide global loading box:
<h1>Click the buttons below to check the effects</h1>
<a href="javascript:void(0)" class="btn show">Display loading</a>
<a href="javascript:void(0)" class="btn hide">Hide loading</a>
<script>
function ready(callback) {
// Call directly if JSBridge has been injected
if (window.AlipayJSBridge) {
callback && callback();
} else {
// Monitor the injected events if JSBridge hasn't been injected
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>