Вот мой загрузчик AJAX для получения всех строк из базы данных.
Код: Выделить всё
var inProcessVideos = false;//Just to make sure that the last ajax call is not in process
setTimeout( function () {
if (inProcessVideos) {
return false;//Another request is active, decline timer call ...
}
inProcessVideos = true;//make it burn ;)
jQuery.ajax({
url: 'https://MY-URL.COM/videos-mysql.php', //Define your script url here ...
data: '', //Pass some data if you need to
method: 'POST', //Makes sense only if you passing data
success: function(answer) {
jQuery('#videos-modules').html(answer);//update your div with new content, yey ....
inProcessVideos = false;//Queue is free, guys ;)
},
error: function() {
//unknown error occorupted
inProcessVideos = false;//Queue is free, guys ;)
}
});
}, 500 );А вот содержимое файла PHP, который отображает все результаты из базы данных. Эта часть отлично отображает содержимое.
Код: Выделить всё
Подробнее здесь: [url]https://stackoverflow.com/questions/55064120/phoegap-cordova-to-load-specific-db-row-after-ajax-get[/url]
Мобильная версия