jQuery html attribute not working in IE

前端 未结 24 2716
[愿得一人]
[愿得一人] 2020-12-01 14:32

I am using country and state dropdowns in my form. Whenever the user selects the country in the dropdown, the respective states of the country will populate in the states dr

24条回答
  •  臣服心动
    2020-12-01 15:07

    This is what worked for me: (I tested on IE7 - IE9, and Chrome)

    It looks like the trick for IE is to use a DIV wrapper

    Original html:

    jQuery script:

    $.ajax({
    
                url: "/myapp/myajaxUrl.jsp",
                type: "GET",
                dataType: "html",
                async: false,
                success: function(msg) {
                    $("#dynamicMenu").html(msg);
                });
    

    Where msg is something like:

    I tried .empty() .html() to no avail but the above worked great!

提交回复
热议问题