www.webdeveloper.com
Results 1 to 2 of 2

Thread: Change this script to redirect instead of reloading?

Threaded View

  1. #1
    Join Date
    Dec 2008
    Posts
    1

    Change this script to redirect instead of reloading?

    Hellow!

    Is it possible to change this script to be redirecting to a new page instead of reloading the same one? Or even better, do you know of a php script that does the required redirecting - which in that case would be according to server time? Thank you in advance.

    Code:
    <script type="text/javascript">
                function refreshPage(tme){
    			if(new Date().getMinutes() < 10)
    	               	var time = new Date().getHours() + ":0" + new Date().getMinutes();
    				else
    					var time = new Date().getHours() + ":" + new Date().getMinutes();
    				
                   if (time === tme) {					
                        clearInterval(glblInterval);
                        if(window.location.href.indexOf('?rel=1') == -1){
    					window.location.href = window.location.href + "?rel=1";
    				}
                   }else {
                    	if(window.location.href.indexOf('?rel=1') != -1){
    					clearInterval(glblInterval);
    				}
                    	return;
                   }
                }
                
                var glblInterval = setInterval(function(){
                    refreshPage('12:30'); //SPECIFY THE TIME IN 24HRS FORMAT HERE AT WHICH THE PAGE NEEDS TO BE REFRESHED. 
                }, 1000);
            </script>
    Last edited by jivatma; 12-11-2008 at 05:26 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles