Forums

web2py_ajax.html incomplete with IE on PA? local OK

Hi PA

our registration form at http://w2eca.pythonanywhere.com/welcome/default/user/register fails when using IE8+ but only on pythonanywhere.com, on local server it runs fine. It also works fine in latest Firefox, whether local or at PA.

Not sure why this happens but using the IE developer tools one of the response bodies starts like this:

te this object?";
    var w2p_ajax_disable_with_message = "Working...";
    var w2p_ajax_date_format = "%Y-%m-%d";
    var w2p_ajax_datetime_format = "%Y-%m-%d %H:%M:%S";
    var ajax_error_500 = 'An error occured, please <a href="/welcome/default/user/register">reload</a> the page'
    //--></script>

and the actual code (web2py_ajax.html) reads:

<script type="text/javascript"><!--
    // These variables are used by the web2py_ajax_init function in web2py_ajax.js (which is loaded below).
    var w2p_ajax_confirm_message = "{{=T('Are you sure you want to delete this object?')}}";
    var w2p_ajax_disable_with_message = "{{=T('Working...')}}";
    var w2p_ajax_date_format = "{{=T('%Y-%m-%d')}}";
    var w2p_ajax_datetime_format = "{{=T('%Y-%m-%d %H:%M:%S')}}";
    var ajax_error_500 = '{{=T.M('An error occured, please [[reload %s]] the page') % URL(args=request.args, vars=request.get_vars) }}'
    //--></script>

so it is obviously missing a piece at the beginning.

The translation of 'Are you sure you want to delete this object?' also seems OK.

Thanks in advance for any ideas. w2eca team

[edit by admin: formatting]

That's very odd. It looks OK to me in IE11 -- when you say "in IE8+", what's the latest version that's showing the problem?

We have tried several versions of IE (including 11 we believe) on different PCs and all have failed. Do you mean that specific registration form worked for you?. The only common denominator so far seems to be IE but it might be something else, we just don't know what. Thanks.

When I went to the URL in your original post, everything looked OK and the code in the source was the correct code, without the missing piece at the beginning. This is IE 11 on Windows 7 64-bit. Does that help at all?

The form looks fine but it never submits anything in IE. Did you try that?.

I didn't try it earlier, but I did just now, and I got a verification email, so presumably it was submitted.

Thank you for testing it. The plot thickens... We will run some more tests and see where they take us.

Tested again with a PC with IE 11.0.9600.16521 (11.0.4 KB295418) and it does not work.

The form values are submitted and there is a 200 response but the response body is corrupted, after the {{include 'web2py_ajax.html'}} in the layout.html where it should have the template transformation of

var ajax_error_500 = '{{=T.M('An error occured, please [[reload %s]] the page') % URL(args=request.args, vars=request.get_vars) }}'

it has

var ajax_error_5a">BC</option><option ... garbage ....

We also upgraded to web2py 2.9.5 and IE11 still fails. And here is the kicker: IE8 works! Stumped!

Try looking at things like the content-length header and the the character encoding header that you're sending. It may be that the IE that fails is being more/less forgiving of errors or it may be forcing your app (or framework) into an unexpected code path with it's accept headers.

Another possibility that just occurred to me is that it could be a different default ajax timeout between the browsers or something like that.