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 9030163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T07:25:17+00:00 2026-06-16T07:25:17+00:00

I’m using the following script to refresh my iframe. In case the refresh fails,

  • 0

I’m using the following script to refresh my iframe. In case the refresh fails, it will show a different iframe:

<script type=text/javascript>
setInterval(function(){
var rq = new XMLHttpRequest();

rq.open('GET', document.getElementById('tracker').src, true);

rq.onreadystatechange = function() {
    if(rq.readyState === 4) {
        if(rq.status === 200) {
        } else {
    document.write('<iframe src="tracker2.html" style="border:0px #CCD1B9 none;" scrolling="no" frameborder="0" marginheight="0px" marginwidth="0px" height="407px" width="417px"></iframe>');
        }
    }
};
rq.send(null);
    document.getElementById("tracker").src+="";
},2000);
</script>

My problem is below line: } else {

I would like to else, show a different iframe, but to keep reloading the main page again.

So to be clear: the above code is mainpage.html, and it will show iframe tracker2.html if it is unable to refresh iframe tracker.html, and I would like iframe tracker2.html to keep refrshing or REDIRECTING to mainpage.html every X seconds.

  • 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-06-16T07:25:18+00:00Added an answer on June 16, 2026 at 7:25 am

    It seems like you should combine the logic of mainpage.html and tracker2.html together into one auto refreshing page but you may have your reasons not to do that.

    Instead I suggest a meta refresh tag to help auto refresh the page:

    <meta content="5; URL=/tracker2.html" http-equiv="Refresh" />
    

    That will refresh after 5 seconds.

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

Sidebar

Related Questions

I have a small JavaScript validation script that validates inputs based on Regex. I
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I am reading a book about Javascript and jQuery and using one of the
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I used javascript for loading a picture on my website depending on which small
I am using JSon response to parse title,date content and thumbnail images and place

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.