Inserting JavaScript in the .innerHTML does not cause it to run.
I have what I call a mini-feed in which a user submits a post. This initiates an ajax call which saves
The following code should work:
function onSuccess() {
src = document.createElement('script');
src.innerHTML = this.responseText;
document.body.appendChild(src);
}
But I would agree with cwallenpoole that why not have all that javascript code (for pretty-fying the date) be already written in advanced in the main page? (or script included or something).