Here's another weird problem I have had, trying to get the BCRA web pages to run on the new server...
One particular page threw up the annoyingly vague JavaScript "syntax error" when I tried to run it on BCA's new server. It was fine on the old server, and on localhost.
I eventually realised that - for what reason I do not know - it had been created with MAC-style line endings (i.e. hex 0D). when I converted these to PC-style (0D0A) it ran without error. (Perhaps Unix-style line endings of 0A would also have worked? - let's just see: yes they do work).
The syntax error was caused because JavaScript was expecting to see a line ending, and didnt.
Im assuming - guessing - that the old server I was running the BCRA site on ws either Windows-based or had some property set somewhere to map line endings.
Line endings and Javascript problems
- David Gibson
- DG test
- Posts: 622
- Joined: Thu 16 Mar 2006 23:45
- David Gibson
- DG test
- Posts: 622
- Joined: Thu 16 Mar 2006 23:45
Re: Line endings and Javascript problems
reminder to myself: use WildEdit. Search for regexp \r([^\n]) and replace with \r\n$1 in files *.htmlDavid Gibson wrote:when I converted these to PC-style (0D0A) it ran without error.