Javascript line endings being stripped in 7.0.6
Posted: Thu Mar 31, 2011 12:55 pm
Since the upgrade to 7.0.6 we have found that some of our scripts quit working. I just found out why. On the server in the custom scriptlet "Home Page.htm" the script looks like this:
But when I view source in the browser it looks like this:
Which means the browser interprets all the javascript code as being a comment.
I tried replacing the line comment marker // with block comment /* and */ so the end result would be like this:
That fixed it. But I'm still confused as to why this is happening all the sudden.
I have double and triple checked and as far as I can tell the line endings on the server are the Windows standard CRLF. I re-transferred the file using binary mode from my Windows box to make sure the line endings are right.
It sure seems like something is stripping off those line endings in my scripts. How do I find out what is doing it? Could it be IIS7, is it AbleCommerce doing it when it puts the final html together? This is really driving me crazy, anyone have any idea what's doing this?
Code: Select all
<script type="text/javascript">
// Instructions on how
// To use the script
Code here;
</script>
Code: Select all
<script type="text/javascript">// Instructions on how // To use the script Code here;</script>
I tried replacing the line comment marker // with block comment /* and */ so the end result would be like this:
Code: Select all
<script type="text/javascript">/* Instructions on how To use the script */ Code here;</script>
I have double and triple checked and as far as I can tell the line endings on the server are the Windows standard CRLF. I re-transferred the file using binary mode from my Windows box to make sure the line endings are right.
It sure seems like something is stripping off those line endings in my scripts. How do I find out what is doing it? Could it be IIS7, is it AbleCommerce doing it when it puts the final html together? This is really driving me crazy, anyone have any idea what's doing this?