First of all I apologize, because I do not know how to speak English correctly, but I need a lot of help.
I have a problem redirecting to another page, I make an ajax query, it returns everything correctly but when I get in the command to redirect I will not try several commands and none worked, I am new to framework7, but I hope they can help me, below the code that I’m using. remembering that the version I use of framework7 is 2.1.3
// Initialize your app
var myApp = new Framework7({
animateNavBackIcon: true,
// Enable templates auto precompilation
precompileTemplates: true,
// Enabled pages rendering using Template7
swipeBackPage: false,
swipePanelOnlyClose: true,
pushState: true,
template7Pages: true
});
// Export selectors engine
var $$ = Dom7;
// Add main View
var mainView = myApp.addView(’.view-main’, {
// Enable dynamic Navbar
dynamicNavbar: false,
});
var subnaview = myApp.addView(’.view-subnav’);
$(document).ready(function() {
$("#LoginForm").submit(function(){
console.log(‘entrou’);
alert(‘entrou’);
$.ajax({
type: “POST”,
url: “http://www.site.com.br/app/webservices.php”,
data: {
acao: ‘login’,
login: $(’#usuario’).val(),
senha: $(’#senha’).val(),
},
async: false,
dataType: “json”,
success: function (json) {
if(json.result == true){
localStorage.login = json.dados.login;
localStorage.senha = json.dados.senha;
localStorage.nome = json.dados.nome;
localStorage.idMembro = json.dados.idMembro;
mainView.router.loadPage({url:‘areamembro.html’, ignoreCache:true});
}else{
alert(json.msg);
console.log(json.msg);
}
},error: function(xhr,e,t){
console.log(xhr.responseText);
}
});
});
})