How can I do an ajax call using Framework7? I already know how to do ajax call using jQuery but I don't know how to do it in Framework7. I am using this for calling an API that returns data.
You can include jQuery or use default Dom7 library, it has the same Ajax methods:
var $$ = window.Dom7;
//do get request
$$.get('path-to-file.php', {id: 3}, function (data) {
console.log(data);
});
//do post request
$$.post('path-to-file.php', {id: 3}, function (data) {
console.log(data);
});
//get JSON request
$$.getJSON('path-to-file.js', function (json) {
console.log(json);
});