Never mind, nothing is wrong with the editor - this happens in all browsers. I think any unescaped </script>s close off the end of the script early
Sorry, I wasn't specific enough - when the file is in the Textastic preview, the code in the picture will display this and cut off the rest of the js:
The problem seems to be that the </script> inside the string in the inline js is interpreted, and then closes off the script tag early.
There is no problem with this in Safari.
Customer support service by UserEcho