As i'm new to web programming, i have some questions. I'd like to implement a very basic chat displayed on my index.php.
It's basically a *.txt-file that should get reloaded automaticalle every second.
My code for now:
<script>
src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.js"
$( document ).ready(function() {
console.log( "ready!" );
});
function getLog() {
$.ajax({
url: 'chat.txt',
dataType: 'text',
success: function(text) {
$("#chat").text(text);
setTimeout(getLog, 1000); // refresh every second
}
})
}
getLog();
</script>
(...)
<div class="panel panel-default">
<div class="panel-heading"><strong>Soloranking.de
Chat</strong></div>
<div id="chat">
</div>
</div>
</div>
My problem is, that nothing it being displayed and i lack on solutions now. I bet it's just a little mistake, but i'd appreciate your help :)
Kind Regards, Jan