开发者

jquery and json no http response on ie

I was trying to resolve this issue by myself, but after 3 days of searching and reading articles i decided to ask for help. Everything works fine in all browser beside ie(7, 8, 9). Firebug doesn't return any error also in ie(https://getfirebug.com/firebug-lite-debug.js) I have no idea what am i doing wrong... pls help.

                                $.ajax({
                            url: review_form.attr('action'),
                            type: 'POST',
                            data: formData,
                            dataType: 'json',
                            cache: false,
                            contentType: 'application/json',
                            success: function(data) {
                                if(data['status'] == "OK") {
                       开发者_如何转开发             $('#feedback').text('Konto zostało poprawnie dodane.');
                                    setTimeout(function(){window.location.href = data['redirect']},3000);
                                }
                                else {
                                    $.each(data, function(key, value) {
                                        // The edit was unsuccessful, put in the error messages.
                                        var UL = $('#frm_reg input[name=' + key + ']').closest('p')
                                            .prepend('<ul class="errorlist"></ul>')
                                            .find('ul');
                                        $.each(value, function() {
                                            UL.append("<li>" + this + "</li>");
                                        });
                                    });
                                }
                            },
                            error: function(xhr, status, error) {
                                alert(status);
                            }
                        }); 

I found mistake in my form, there was typo in "action"

    <form method="post" action="{{ registration_register }}" id="frm_reg">

everything seems to look fine, but...;) after I removed firebug-lite it stopped working on ie 7 and 8....


it's likely ie caching your results.

try adding:

$.ajaxSetup({
    // Disable caching of AJAX responses */
    cache: false
});

to your document ready.


In internet explorer 9 you can also use the developer toolbar by pressing F12 and go to the network tab. Press "Start capturing" and you should be able to see what message is going out and coming back. or if this is not working maybe fiddler can help to see if you are actually sending out the ajax call?

did you also check that the url property is correct?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜