Javascript line endings being stripped in 7.0.6

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
SteveHiner
Lieutenant (LT)
Lieutenant (LT)
Posts: 58
Joined: Thu Jun 21, 2007 8:27 pm

Javascript line endings being stripped in 7.0.6

Post by SteveHiner » 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:

Code: Select all

<script type="text/javascript">
// Instructions on how
// To use the script

Code here;
</script>
But when I view source in the browser it looks like this:

Code: Select all

<script type="text/javascript">// Instructions on how // To use the script Code here;</script>
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:

Code: Select all

<script type="text/javascript">/* Instructions on how To use the script */ Code here;</script>
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?
Steve

Post Reply