Forum Moderators: open

Message Too Old, No Replies

Reloading Iframes with time factor

Reloading Iframes with time factor

         

Sallow

7:58 am on Aug 15, 2002 (gmt 0)

10+ Year Member



I'm working on a website. On the index page I would like to have 3 <tr> with 3 <td> each td containing an Iframe with a thumbnail image 100x100 px.

I would like each Iframe to reload itself after waiting randomly between 10 and 45 sec. and randomly pick a thumbnail from a database by every reload.

Is that possible?

As you can see I'm at the moment just refering to a page src='beesite/inc.random.image.php?time=3' within the Iframe to see if it was working, this should instead be a call for the database, I think :) .

Hope someone knows how to crack this.

echo "<table width='360' height='360' cellpadding='10' background='gfx/Billeder-bg.gif' cellspacing='0' border='0'>\n"; /// Start table for thumbs

echo "<tr>\n"; // First row (out of 3)

echo "<td width='100' height='100'><iframe src='beesite/inc.random.image.php?time=3' scrolling='no' width='100' height='100' frameborder='no' marginwidth='0' marginheight='0'></IFRAME></td>\n";

echo "<td></td>\n";

echo "<td></td>\n";

echo "</tr>\n";

<tr number 2> As the first
<tr number 3> As the first
echo "</table>\n"; // end table for thumbs

rewboss

8:15 am on Aug 15, 2002 (gmt 0)

10+ Year Member



Hint: What do you suppose the meta refresh tag is for? :)

Crescendo

8:49 am on Aug 15, 2002 (gmt 0)



W3C Accessibility Guidelines point 7.4: "Until user agents provide the ability to stop the refresh, do not create periodically auto-refreshing pages. This automatic refresh can be very disorienting to some users."

:)

Sallow

9:01 am on Aug 15, 2002 (gmt 0)

10+ Year Member



the meta refresh is as far as I know (and that's not a lot) :) for the Metatags for spiders and search-engines

Bless me with your knowledge if I'm wrong:)

Sallow

9:20 am on Aug 15, 2002 (gmt 0)

10+ Year Member



I do not want to autorefresh the hole page but only the thumbs randomly within there own <td> and Iframe

See topmail :)

Crescendo

9:34 am on Aug 15, 2002 (gmt 0)



The effect could be the same - to confuse viewers. They see an image there one minute, then it's gone.

It's only a "Priority 2" issue anyway, so it's not essential to cut out refreshes altogether. If the images aren't links, then no worries.

I quite like some autorefreshing pages myself, like linkdup.com, but I just wanted to point out the W3C guidelines here.

Sallow

9:47 am on Aug 15, 2002 (gmt 0)

10+ Year Member



Hey Crescendo

I understand your worries :), but the images will not be links.

If you look at www.linkdup.com and imagine that the thumbs on the right are not links but only images and they are changing every once in a while.

rewboss

1:04 pm on Aug 15, 2002 (gmt 0)

10+ Year Member



W3C Accessibility Guidelines point 7.4: "Until user agents provide the ability to stop the refresh, do not create periodically auto-refreshing pages. This automatic refresh can be very disorienting to some users."

Many user agents do allow you to stop the refresh: use the browser's Stop button. It stops quite a lot of things, including GIF animations. (Works on Internet Explorer at any rate.)

If you're really worried about it, include a link that says "Halt slide show" or something, which downloads the current page but without the <meta> tag -- easy enough to implement in PHP.

Re the meta refresh tag:

<meta http-equiv="refresh" content="10" />

will cause the current document to reload after 10 seconds. As a general rule of thumb, any <meta> tag with an http-equiv attribute in some way affects the behaviour of the browser (such as selecting a particular character set or, as here, causing it to send a request to the server), and may not be relevant to spiders.

tedster

1:27 pm on Aug 15, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Perhaps more to the point for this discussion, the content attribute can be expanded to load a different page after the declared interval:

<meta http-equiv="refresh" content="10;url=http://www.example.com/newpage.html">

papabaer

2:26 pm on Aug 15, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Here is a previous discussion about "re-loading" iframes. You can use this technique in many creative ways, including image galleries and story boards.

[webmasterworld.com...]

moonbiter

2:49 pm on Aug 15, 2002 (gmt 0)

10+ Year Member



To do the refresh at a random interval will require scripting, however. ...

Sallow

7:18 am on Aug 16, 2002 (gmt 0)

10+ Year Member



I solved my problem. :)

Big thanks to everybody.

<sorry, no URLs>

[edited by: tedster at 7:33 am (utc) on Aug. 16, 2002]

tedster

7:36 am on Aug 16, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Looks like you went for a meta-refresh to the same URL, but then used PHP to script in a different image on each refresh, and all nine iframe images display the same image.

Interesting effect...sorry we don't allow personal URLs in posts. The rule keeps the self-promoters under control.

Sallow

8:11 am on Aug 16, 2002 (gmt 0)

10+ Year Member



Ok Tedster

I didn't know that :)