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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:50:27+00:00 2026-06-04T11:50:27+00:00

OK so im trying to have a webpage that rotates every 30 seconds now

  • 0

OK so im trying to have a webpage that rotates every 30 seconds now i have what i need for this but instead of using an array like in what i have now see code below

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Rotating Page</title>
<style type="text/css">
* {
    margin:0;
    padding:0;
    border:0;
}
html, body, iframe {
    height:100%;
    width:100%;
    overflow:hidden;
}    
</style>
<script type="text/javascript">
var pages = new Array(); // this will hold your pages
pages[0] = 'MY-LINK-HERE';
pages[1] = 'MY-LINK-HERE';
pages[2] = 'MY-LINK-HERE';
pages[3] = 'MY-LINK-HERE';
pages[4] = 'MY-LINK-HERE';
pages[5] = 'MY-LINK-HERE';

var time = 30; // set this to the time you want it to rotate in seconds

// do not edit
var i = 1;
function setPage()
{
    if(i == pages.length)
    {
        i = 0;  
    }
    document.getElementById('holder').setAttribute('src',pages[i]);
    i++;
}    
setInterval("setPage()",time * 1000);
// do not edit
</script>
</head>

<body>
<iframe id="holder" src="MY-SPLASH-PAGE-HERE" frameborder="0" scrolling="no"></iframe>
</body>
</html>

where in MY-LINK-HERE for the pages array i would like to use my rss link and get the list of links and add them to the pages array or something similar

my rss link is http://directitpros.com/cbm/wp/?feedpages

so i just want to load the text in the pages variable

  • 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-04T11:50:30+00:00Added an answer on June 4, 2026 at 11:50 am

    It took me some time but I got it (tested and working)

    • This example uses jQuery and jGFeed.
    • jGFeed is a plugin for jQuery to do anything you want with RSS feeds.
    • In the HTML source you can get the URL of the plugin to save it.

    Observations:

    1. Your RSS link is not working properly, please check it!
    (http://directitpros.com/cbm/wp/?feedpages)

    When using your link I receive this error from the plugin I am using in browser console:

    "Uncaught TypeError: Cannot read property 'feed' of null"
    

    2. Make sure the links you want to use in iframe are able to browse by iframe:

    Example:

    If URLs are not able to browse by iframe you will get this message in your browser console and your iframe will be empty:

    "Refused to display document because display forbidden by X-Frame-Options."
    

    3. If you find a working RSS url and links from it fit the above requirements, use this live example I made to test:

    http://jsfiddle.net/oscarj24/qWdqc/

    (Check browser console and check messages that will appear)


    Let’s go with the code 🙂

    HTML:

    <script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"></script> 
    <script src="http://dl.dropbox.com/u/15208254/stackoverflow/jquery.jgfeed.js" type="text/javascript"></script>
    <iframe id="holder" src="" frameborder="0" scrolling="no"></iframe>​
    

    CSS:

    html, body, iframe {
        height:100%;
        width:100%;
        overflow:hidden;
    }​
    

    JS:

    // Array containing pages
    var pages = new Array();
    
    // Time in seconds to rotate pages
    var time = 30;
    
    // Variable for loop purpose
    var i = 1;
    
    $(function(){
    
        $.jGFeed('http://working-rss-url',
          function(feeds){
    
            // Check for feeds
            if(!feeds){
              // There was an error, remote url not ok or no feeds
              return false;
            }
    
            // Do whatever you want with feeds here
            for(var i=0; i<feeds.entries.length; i++){
              var entry = feeds.entries[i];
              // Fill array with RSS entries
              pages.push(entry);
            }
    
            // If array contains urls
            if(pages.length != 0){
                // Rotate pages every 'x' seconds
                setInterval(function() {
                    if(i == pages.length){
                       i = 0;  
                    }
                    // Replace iframe scr with RSS entry link every 'x' seconds
                    $('#holder').attr('src', pages[i].link);
                    i++;
                }, time * 1000);
            }
    
        }, 5); // Number of feeds you want to recover
    
    });
    

    Hope this helps.

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

Sidebar

Related Questions

I have a webpage that I read using Python and BeautifulSoup, say soup=BeautifulSoup(urllib2.urlopen(site)) .
I have a webpage in asp.net that I am trying to lay out and
I have a webpage that is giving me this error on a couple of
So I have a webpage that queries some data based on this parameter search.php?state=AL
I am trying to write a dynamic form using PHP. I'd like to have
I have a flash video player in a div inside a webpage, I'm trying
I'm trying to select an element from my webpage... I have inserted a control
I'm trying to pull some data from a webpage. I have it partially working,
I have a webpage that you pass in an id parameter (via a querystring),
I have an asp.net webpage that only contains a textbox and a button. The

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.