0
votes

I'm fairly new to Sharepoint 2007 , I use a content editor webpart for refreshin page in sharepoint portal.

i use following code in Source Editor of CEWP:

<script type="text/javascript" language="javascript">
    var reloadTimer = null;
    var sURL = unescape(window.location.pathname);
    function setReloadTime(secs)
    {
        if (arguments.length == 1)
        {
            if (reloadTimer) clearTimeout(reloadTimer);
            reloadTimer = setTimeout("setReloadTime()", Math.ceil(parseFloat(secs)*1000));
        }
        else
        {
            reloadTimer = null;
            location.reload(true);
            window.location.replace( sURL );
        }
    }
     setReloadTime(30);
</script>

this code work fine, but i like to use this content editor web part in each page i like. and i like to can set reload time without editing Source Editor of content editor web part. Could any body help me.

Any help appreciated

1
Well, this is very different from the originally posed question! If you want it on every page without having to deploy new features, create a page template for it -- say, "auto-refreshing page". Add the JS to the source code. The auto-refresh time could be a column for that page type.Jhong

1 Answers

0
votes

Just use a content editor web part, with the following code in source view:

10000 is 10 seconds -- change it to whatever you need

<script type="text/javascript">
    //<![CDATA[
    setTimeout('window.location.reload();', 10000);
    // ]]>
</script>