This topic describes the JavaScript APIs of WVNavigator. You can refer to this topic when you create HTML5 apps or miniapps. You can use the JavaScript APIs of WVNavigator to close the current page and open a new miniapp page.
WVNavigator.pop
Closes the current page.
Input parameters
Custom: If the input parameters are empty, the current page is closed in the default mode. If you want to implement the
NavigatorAdapterAPI by using custom methods, you must specify the input parameters.
Callback parameters
Parameters for a success callback:
No callback parameters exist.
Parameters for a failure callback:
[
string]msg: the error message.
window.WindVane.call('WVNavigator', 'pop', {p, function(e) {
}, function(e) {
alert('failure: ' + JSON.stringify(e));
});WVNavigator.push
Opens a new page.
Input parameters
If you want to implement the NavigatorAdapter API by using custom methods, you must specify the input parameters.
If you do not want to implement the NavigatorAdapter API by using custom methods, you must specify the following input parameter.
[
string]url: the URL of the miniapp page that the user wants to open.
Callback parameters
Parameters for a success callback:
No callback parameters exist.
Parameters for a failure callback:
[
string]msg: the error message.
var params = {
url: 'xxxx'
};
window.WindVane.call('WVNavigator', 'push', params, function(e) {
}, function(e) {
alert('failure: ' + JSON.stringify(e));
});