The variable shifted seems to be never declared. Assigning variables without defining them first makes them global. If this was intended, consider making it explicit like using window.shifted.
Loading history...
15
if(!shifted){
16
$(".submit").click();
17
}
18
});
19
}
20
});
21
});
22
23
24
window.setInterval(getMessages, 1000);
25
26
function getMessages(){
27
$.getJSON('database.json', function(json) {
28
if(json.messages.length > 0){
29
for (var i = amountOfMessages; i < json.messages.length; i++) {