Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5935291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:14:00+00:00 2026-05-22T15:14:00+00:00

So, this is a pretty simple sounding question, but I’m interested in other peoples

  • 0

So, this is a pretty simple sounding question, but I’m interested in other peoples opinions about the “best” practice for handling this. The site is a presentational delivery of building energy information; it’s mostly HTML5/CSS3 and jQuery with some heavy graphics. It does use PHP to leverage the building information via an API, however it does not drive any other attribute of the site.

So, this site needs to do one last thing, after a set interval(usually several minutes long) the page needs to redirect the user to the next page in the flow. It’s important that the browser also refreshes periodically(to restart looping animations).

I’ve certainly considered the very simple:

<html>
<head>
<script type="text/javascript">
<!--
function delayer(){
    window.location = "../javascriptredirect.php"
}
//-->
</script>
</head>
<body onLoad="setTimeout('delayer()', 300000)">
</body>
</html>

This works, but it doesn’t “feel” like the best option. Thanks in advance to anyone who can contribute an idea.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T15:14:01+00:00Added an answer on May 22, 2026 at 3:14 pm

    I think your method would work best. When you refresh the page with code, you could add a querystring parameter to the url and on page load if you detect that parameter there, then you know it has refreshed already and you may then decide to redirect after a couple of page refreshes.

    function delayer(){
        var refresh_value = getQuerystring('r')
        if(refresh_value == '')
            window.location = "../samepage.php?r=1"
        if(refresh_value == '1')
            window.location = "../samepage.php?r=2"
        if(refresh_value == '2')
            window.location = "../javascriptredirect.php"
    }
    

    Function pulled from: http://www.bloggingdeveloper.com/post/JavaScript-QueryString-ParseGet-QueryString-with-Client-Side-JavaScript.aspx

    function getQuerystring(key, default_)
    {
      if (default_==null) default_=""; 
      key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
      var regex = new RegExp("[\\?&]"+key+"=([^&#]*)");
      var qs = regex.exec(window.location.href);
      if(qs == null)
        return default_;
      else
        return qs[1];
    }
    

    If this had been earlier in development I would suggest loading content of another page, slide out your current content then slide in the new content. That would have opened the door to easily trigger page refreshes, too. When I think of a website as a slideshow I think of jquery mobile. When you click on a link in jqmobile, it loads the next page’s content in to the current DOM, then it slides out the old content and slides in the new content. Upon loading the new content, a hash-tag is appended to the url so, it helps to image how it is really just referencing another block of content on the same page (like when using <a href="#paragrapn2">Go to Paragraph 2</a>).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a pretty simple question but I'm somewhat stumped. I am capturing sections
This a pretty simple question (I assume). Probably a repost, but I couldn't find
This is pretty simple question, but I'm having really hard time with it. I
This is a pretty simple question, but my Google skills haven't gotten me the
Im sure this is pretty simple but I just cant seem to find the
this is probably pretty simple, but I've got this text file containing a bunch
This should be pretty simple, but I am new at LINQ. I have a
This is probably pretty simple, but I can't figure out how to do it:
This is a pretty simple question and I'm assuming the answer is It doesn't
This seems pretty simple and maybe I'm just overlooking the proper flag , but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.