The first parameter of setInterval is a function, but you haven’t made a function. You also have a variable, a, which you don’t actually use.
Your code should look something like this:
setInterval(function() {
// a isn't actually used here and so appears unnecessary
a = location.replace("https://exampl.example.repl.co");
a.preventDefault();
// you could do
// location.replace("https://exampl.example.repl.co").preventDefault();
$.ajax({
type: "POST",
URL: "/",
//data: {
//todo:$("#todo").val()
//},
success: function() {
// I'm assuming timeping is defined outside of this function, if not, this will produce an error
alert((Date.now() - timeping) + "ms");
}
});
}, 1000);