Witam. Ogólnie rozbija się problem o prosty czat, a mianowicie
Posiadam index.php w którym includowany jest config.php.
Config.php posiada metode __autoload ktora wczytuje klase Database gdzie sa 3 metody statyczne getConnection(), add_news(), select_news(), baza mysql w PDO.
I teraz pytanie jak ajaxem podłączyć żeby w w index.php w div id="wyswietl" automatycznie odswiezalo dane z metody select_news()
$(document).ready(function(){
setInterval ( "get()", 5000 );
});
function get(){
$.ajax({
type: 'GET',
url: 'config.php',
success: function(data){
$("#wyswietl").html(data);
}
});
}
Co wpisać w url oraz success ?