I am getting some html and inserting it with .html(), after which I am trying to get the width of one of newly inserted elements with .width() (which h
.html()
.width()
We found out that document.ready was not good enough so 300ms worked well:
setTimeout(function() { resizeHeightOfMyDiv(); $(window).on("resize", function() { resizeHeightOfMyDiv(); }); }, 300);