My ajax success:function()
runs a line of code which opens a new window and inserts data into it. Rigth now my code looks like this:
success: function(data) {
var url = location.href;
var w = window.open(url);
w.onload = function() {
w.$('#main').html(data);
};
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
It works just fine in Chrome but If I want to run it in Internet Explorer 11 it won't execute w.$('#main').html(data)
. I also tried:
success: function(data) {
var url = location.href;
var w = window.open(url);
w.addEventListener('load', function() {
w.$('#main').html(data);
}, {
once: true
});
}
Which also works fine in Chrome but with IE it gives me the same result as the line above. Does anybody know why this code doesn't work in IE?