0
我有这个在我的-app.js:Framework7导航不工作
var myApp = new Framework7({
closeByOutsideClick : true,
init: false
});
var $$ = Dom7;
// Add view
var mainView = myApp.addView('.view-main');
function avvia(info) {
$.ajax({
type: "POST",
contentType: "application/json",
//data: {info : info},
data : JSON.stringify(info),
timeout: 6000,
url: "http://localhost:8180/api/",
success: function(data){
urlRedirect = data.urlRedirect;
//window.location.href = urlRedirect;
mainView.router.loadPage(urlRedirect);
},
beforeSend: function() {
myApp.showPreloader('Loading...');
},
complete: function(data) {
myApp.hidePreloader();
},
error: function (xhr, status, error) {
// executed if something went wrong during call
myApp.alert(error, ' Error');
//if (xhr.status > 0) alert('got error: ' + status); // status 0 - when load is interrupted
}
});
}
myApp.init();
我Ajax调用后,我想将页面重定向到在成功的情况下返回数据领域的新页。 我的问题是,Framework7导航mainView.router.loadPage(urlRedirect)
不工作,而标准window.location.href = urlRedirect;
工作正常。我该如何解决这个问题?