How to get title through Ajax?

I want to get the title for

var myApp = new Framework7({
modalTitle: 'My Title'

How could I get it thorugh ajax?

Alternatively, I tried to set the title for myApp.alert with a global variable:

var title;

test_ajax( function(data) {
	title = data.pagename;
})

But Ajax always runs later than the previously defined variable and I get “undefined”. Whats the right way?

test_ajax( function(data) {
	myApp.params.modalTitle = data.pagename;
})
1 Like

// Init App
var myApp = new Framework7({
root: ‘#app’,
theme: theme,
material: true,
modalTitle: ‘EmployeePortal’,
materialRipple: false,
statusbar: {
iosOverlaysWebview: true,
},
routes: routes,
});
I am set modeltitle but not show in alert dialog .how work this modaltitle