In the OWASP XSS prevention cheat sheet it says that untrusted data cannot be safely put inside the .setinterval JS function. Even if escaped/encoded, XSS is still possible.
But if I have something like this:
setInterval(function(){ alert('<%=UNTRUSTED_DATA%>'); }, 3000);
And if I JS encode "UNTRUSTED_DATA", how would XSS be possible?