V2 mainView.router.load analog


#1

in v1 version i have pretty simple code loading html with ajax and rendering new view

$$.ajax({
url: ‘http://somedomain.com?get=’ + Msg,
crossDomain: true,
statusCode: {
404: function (xhr) {
alert(‘page not found’);
}
},
success: function (data) {
$$(’.preloaderWrap’).hide();
mainView.router.load({
content: data,
});
}
});

as i understand app.request.get replaced ajax and it is clear
Bot what is about
mainView.router.load({
content: data,
});
what i should use now?


#2

You need to specify routes in v2, check there are also async routes that allow you to do it http://framework7.io/docs/routes.html#async-route