Since this was very mysterious to me at first, I thought I would post the answer I found, for future reference.
The question was, why would some JavaScript that worked perfectly well on my previous web host, stop working on a new web host?
Here’s the JavaScript, a revised version of ReloadTextDiv from the EE wiki. (Note: I found that the ReloadTextDiv from the EE wiki ran fine on both hosts.)
I downloaded the Firefox extension called FireBug, that contains a great JavaScript debugger. It showed me that these lines were considered incomplete:
splitText = NewText.split(/
/).join("
");
splitText = splitText.split(/
/).join("
");
I tried replacing the new line characters with control characters (in Javascript, “\n” means the same invisible “new line” character that you get when you hit the return key on your keyboard). That fixed it. Here’s the version that’s now working on my site:
I guess some web hosts require the “\n” character.