ERR_CONTENT_DECODING_FAILED when using .ajax

ERR_CONTENT_DECODING_FAILED when using .ajax

I have a log file at http://www.pokersoftwareanalysis.com/tail/log.log that looks like:

    2015-05-20 14:19:52.306655 hello
    2015-05-20 14:19:55.406846 hello
    2015-05-20 14:19:57.292777 hello

The log file was generated on a Godaddy shared linux hosting account using this code:

    with open( log_path, 'a' ) as f:
        f.write( '%s hello\n'%datetime.now() )

I have an html file at http://www.pokersoftwareanalysis.com/tail/problem.htm that attempts to load the log file. The content of the html file is just a brief exerpt from https://github.com/ukhas/js-logtail. It contains this:

    <!DOCTYPE html>
    <html>
        <head>
            <script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
            <script>
    
    var range='1-';
    $.ajax( 'log.log', {
           dataType: "text",
           cache: false,
           headers: {Range: "bytes=" + range},
           success: function (data, s, xhr) {
               console.log( data );
           },
           error: function (xhr, s, t) {
               loading = false;
   
               if (xhr.status === 416 || xhr.status == 404) {
                   /* 416: Requested range not satisfiable: log was truncated. */
                   /* 404: Retry soon, I guess */
   
                   console.log( xhr.status)
   
               } else {
                   throw "Unknown AJAX Error (status " + xhr.status + ")";
               }
           }
       });
            </script>
        </head>
        <body>
        <h1>Hello</h1>
        </body>
    </html>

Now, when I open the html page, I get an ERR_CONTENT_DECODING_FAILED error from the Javascript console.

I do not get that error if I only write to the log file twice (i.e. it only has 2 line in it, rather than 3).

What is causing the problem and how can I avoid it? Ideally I would like to use Python's logging API rather than file.write, but it gives the same error as well.

I am using Google Chrome on a Lubuntu machine.

I have tried replicating the request using curl, following the instructions from http://www.cyberciti.biz/cloud-computing/http-status-code-206-commad-line-test/:

    curl --header "Range: bytes=75-" http://www.pokersoftwareanalysis.com/tail/log.log

However, curl retrieves the data successfully and returns no error.