How to make a blank page in WebViewer before loading a new page

I need to make visible the WebViewer after the page has been loaded, or at least i need to make the page blank before making it visible.
I tried by GoToUrl="" or HomeUrl="" and GoHome… but in any case i have for half a second the old image that was previously loaded.
What’s the proper way? Should I use a timer to wait for the previous page being blanked?

You could try using a “blank” html page with a javascript timer in it (setInterval()) that will then load your required page after a set time ?

Or similarly load a blank page in the webviewer then use a clock to then load your required page ?

Hi TIMAI2,
the critic moment is when passing from the old page, previously loaded, to the new page, it lasts few millisec but you can see the old page before loading the new one.
I’m sorry to add a timer just for doing this :slight_smile: but i will do if there isn’t another way

Hi crix2

Can you tell us why it’s a problem? It’s just normal behaviour.

It’s not a big issue Chris.
I have some buttons and when I press one of them a different webpage must appear (but without showing the last one)
With a timer I can wait for the white page to be loaded if there is no other chance.

Load the blank/white page, then wait…

An example:

<!DOCTYPE html>
<html>
<meta name=“viewport” content=“width=device-width, initial-scale=1.0”>
<head>
	<title>Load Google</title>
</head>
<body>
	<h2>Blank Page</h2>
	<script>
	setInterval(function(){
		 window.location.href = "https://www.google.co.uk";
		 }, 3000);
	</script>
</body>
</html>

If you introduced the webviewstring, you could use this to set the urls from the app, and you would only need the one html page:

<!DOCTYPE html>
<html>
<meta name=“viewport” content=“width=device-width, initial-scale=1.0”>
<head>
	<title>Load Google</title>
</head>
<body>
	<h2>Blank Page</h2>
	<script>
	setInterval(function(){
		 window.location.href = window.AppInventor.getWebViewString();
		 }, 3000);
	</script>
</body>
</html>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.