I used a .js to avoid landscape view from mobile device. I edited a white full-screen image saying \"this site is not thought to be viewed in landscape mode, please
.js
You need to move the doOnOrientationChange() function outside of the other one, and then call it on pageload. Like this it should work:
doOnOrientationChange()