Jquery ajax call failed only in IE

This ajax request checks if a TIF file exists in a specific directory and either sets a button to open the file or display an error message if it does not exist.

        $.ajax(
        {
            cache: false,
            url: directory,
            success: function() { $("#img" + row).click(function() { window.location.href = directory; return false; }) },
            error: function(data) { alert(data.responseText); $("#img" + row).click(function() { $("#ImageDialog").dialog("open"); return false; }) }
        });

Sometimes, but not always, IE8 returns a failure, even if the file exists, and FF and Chrome return successes. I added "alert (data.responseText)", trying to debug the problem, but I never get a warning window. IE instead throws "System Error: -1072896748".

What's happening?

+3
source share
2 answers

Ok, I believe I found the reason / solution posted here: IE does not launch jQuery Ajax success

It says that

IE, , , xml, , , , , xhr.status 200 . "" FF , if (xhr.status == 200).

0

Source: https://habr.com/ru/post/1748578/


All Articles