scrollHeight doesn't work since last Chrome update

Viewed 1235

I had this function for a long time and it made my iframe change height on click, but since the last update of chrome it stoped working on chrome. i get the value 0, while on explorer or other platform it works great. any ideas how to make it works again?

function calcHeight() {
        var the_height = document.getElementById('resize').contentWindow.document.body.scrollHeight;
        window.alert(the_height);
        document.getElementById('resize').height= the_height;
}
1 Answers

You could try to change how you reference the document to:

var the_height =
  document.getElementById('resize').contentWindow.document.documentElement.scrollHeight;
Related