I have a JavaScript function which resizes automatically a div when the window gets resized that looks like this:
window.onresize = function(){container.style.height = document.body.clientHeight - 300}
The problem is that when the window gets resized to a very small size (so that document.body.clientHeight
is less than 300), it shows an error message. Is there a way to keep this error message from appearing (like On Error Resume Next
in VBScript) or of blocking a resizing to very small sizes (see here)?
I found an equicalent of On Error Resume Next
in JavaScript here:
window.onerror = function(){
return true;
}