jQuery html attribute not working in IE

前端 未结 24 2664
[愿得一人]
[愿得一人] 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 14:57

    I had the same problem after receiving an AJAX HTML-Request with the function jQuery.ajax() and then trying to parse the result with jQuery( html_result_data ). The solution was to strip the header and all tabs and "returns" in the html_result_data like this:

    success: function( data ) {
       // God this is ugly
       data = data.split("")[1].split("")[0];
       data = data.split("\t").join("").split("\r").join("").split("\n").join("");                      
       data = jQuery( data );
       ...
    }
    

提交回复
热议问题