first things first,
p_web.BodyOnLoad('setTimeout(function() { window.scrollTo(0, 1) }, 100);')
I get: Invalid string (misused <...> or {...}, or literal is too long)
The error is exactly right, in a clarion string the { character has a special meaning. (you can read up on that in the help if you like). The line of code should be
p_web.BodyOnLoad('setTimeout(function() {{ window.scrollTo(0, 1) }, 100);')
to compile correctly.
But wait, there's more.
Or more to the point, that's the wrong way to do what you want.
The right answer lies in the way JavaScript works. You've done the correct thing in creating rotate.js, and it contains the function, something like this I'm guessing;
function initScreen() {
setTimeout("window.scrollTo(0,1);",100);
}
function updateOrientation() {
initScreen();
}
Well, if you add the following line to the js file, at the bottom,
initScreen();
then when the js loads, that line will just run. IOW when the browser loads the js file, then it recognises the functions as, well, functions, and stores them for later use. But code outside functions (like the line at the bottom we just added) is executed - because it's not inside a function.
cheers
Bruce