You can click the subtitle in the navigation bar (subtitleClick) to trigger a callback.
Use the subtitleClick interface
document.addEventListener('subtitleClick', function (e) {
alert('subtitle clicked')
}, false);Code example
The following is a basic demo.
<h1>Click the subtitle to see the result</h1>
<script>
document.addEventListener('subtitleClick', function(e) {
alert('subtitle clicked')
}, false);
function ready(callback) {
// If AlipayJSBridge is ready, call the callback.
if (window.AlipayJSBridge) {
callback && callback();
} else {
// If not, listen for the AlipayJSBridgeReady event.
document.addEventListener('AlipayJSBridgeReady', callback, false);
}
}
ready(function() {
AlipayJSBridge.call('setTitle', {
title: 'Title',
subtitle: 'Subtitle'
});
});
</script>