I am writing my page on wordpress. At one point I want to load my notification.php every time interval like for example first in 1 second and then 10 seconds. For that I use js function:
function loadNotification() {
$("#randomtext").load("notification.php");
}
and then:
$(document).ready(function(){
setTimeout(function(){
loadNotification();
var auto_refresh = setInterval(function() {
loadNotification();
}, 10000);
}, 1000);
});
This code right there seems to be giving me error Cannot modify header information - headers already sent
. Though simply this:
loadNotification();
doesn't.
I checked my code and deleted any unnecessary empty line or space. That didn't seem to fix my problem. Any advice would be helpful. Thanks.