Jquery AJAX not working in IE9

前端 未结 1 464
我寻月下人不归
我寻月下人不归 2020-12-19 01:23

I am writing an ajax web application but for whatever reason when I perform a GET against an internal data service in Internet Explorer 9 (IE9) it does not work. This same c

相关标签:
1条回答
  • 2020-12-19 01:45

    Look's like its a problem with

    console.log()

    IE has no console object when Developer tools is not open.. Try running your code by commenting your console.log and try again..

    $(document).ready(function () {
    
        var loginUrl = "http://omittedurl.com";
        //console.log(loginUrl);
        $.ajax({
            type: "GET",
            url: loginUrl,
            dataType: "json",
            success: function (response) {
               // console.log("RESPONSE: " + response);
               alert("RESPONSE: " + response)
            }
        });
    });
    

    If you want to use console , you need to define that first if Developer tool's is not open..

    if (typeof console === "undefined" || typeof console.log === "undefined") {
         console = {};
    
    0 讨论(0)
提交回复
热议问题