0

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)?

Community
  • 1
  • 1
Donald Duck
  • 8,409
  • 22
  • 75
  • 99

1 Answers1

0

I found an equicalent of On Error Resume Next in JavaScript here:

window.onerror = function(){
   return true;
}
Community
  • 1
  • 1
Donald Duck
  • 8,409
  • 22
  • 75
  • 99