IE prompts to open or save json result from server

后端 未结 9 1240
既然无缘
既然无缘 2020-11-29 22:28

Internet explorer in compatibility mode gets the data from the server in an ajax callback method, and pops-up a dialog if I want to save the data or open. How to get rid of

9条回答
  •  猫巷女王i
    2020-11-29 22:42

    Is above javascript code the one you're using in your web application ? If so - i would like to point few errors in it: firstly - it has an additional '{' sign in definition of 'success' callback function secondly - it has no ')' sign after definition of ajax callback. Valid code should look like:

    $.ajax({
            type:'POST',
            data: 'args',
            url: '@Url.Action("PostBack")',
            success: function (data, textStatus, jqXHR) {
                    alert(data.message);
                }
        });
    

    try using above code - it gave me 'Yay' alert on all 3 IE versions ( 7,8,9 ).

提交回复
热议问题