The startH5App method opens an HTML5 application. This method is no longer supported. Use the startApp API instead.
How to use the startH5App API
AlipayJSBridge.call('startH5App', {
appId: '20000067',
url: '/www/index.html',
});Code example
<h1>Click the button to see the effect</h1>
<a href="javascript:void(0)" class="btn dream">Open Dream Savings</a>
<script>
function ready(callback) {
// If jsbridge is already injected, call it directly.
if (window.AlipayJSBridge) {
callback && callback();
} else {
// If not injected, listen for the injection event.
document.addEventListener('AlipayJSBridgeReady', callback, false);
}
}
ready(function(){
document.querySelector('.dream').addEventListener('click', function() {
AlipayJSBridge.call('startH5App', {
appId: '20000981',
url: '/www/dream-create.html',
// Pass in the startup parameters.
});
});
});
</script>API reference
AlipayJSBridge.call('startH5App', {
appId, url, ...param
})Request parameters
Parameter | Type | Description | Required |
appId | string | The HTML5 application ID. | Yes |
url | string | The parameters to start the application. These are defined by the specific business application. | N |
param | object | A key-value object. Nesting is not supported. | N |