Adding Java script to a page to refresh it

Adding Java script to a page to refresh it

  
Hi guys.

I have this script 
<script type="text/javascript">
    setTimeout(function () { 
      location.reload();
    }, 3000);
</script>
I would like to add it to a page hoping that it will refresh it every 3 seconds. Where exactly should I inster this script for it be enabled?

Thanks,

Jean-Pierre



Solution
just place it on the screen as an expression (and escape content to no)

Solution
Thanks.

I have a script that refreshes a whole page. How can I refresh a spesifc web block?

Thank you.
instead of reload, use the fakenotifymessage-width and it's javascript-method.

then in the screenaction, you refresh the webblock.

or you can checkout the lightweight-ajax refresh component in the forge...

I'm not sure what you mean here.

Should it look like this:

<script type="text/javascript">
    setTimeout(function () { 
      location.fakenotifymessage();
    }, 3000);
</script>

In the meanwhile I have found this

function RefreshResults(id)
{
    var refreshFunction = document.getElementById('RefreshGuardsContainer.Id').onclick;
    refreshFunction();
    return false;
}
 
var intervalId = setInterval('RefreshResults()', 5000);

The last one was recommended on another OutSystems post. One thing I'm concerned about is syntax. Please let me know if you think that might not work for any reason.
no, check out the fakenotifywidget (webblock) in richwidgets.

place that webblock on your screen with a name (for example 'fake' )
this will also need a onchange desitination, which will be the screen-action where you refresh the webblock.

then in the code

<script type="text/javascript">
    setTimeout(function () { 
      OsNotifyWidget('" + fake.Id + "','some dummy message or empty');
    }, 3000);
</script>