Jump to content

looping Iframe reload.. need help


efficacious

Recommended Posts

Hi all,

 

I've written a chat box via php/mysql and my only real issue with it is that I cannot get it to refresh the chat display properly.

I tried adding a meta refresh to the display page that loads into the Iframe but FF has a bug in which it fails to recognize the new location of the Anchor so it screws up the autoscroll for the chat messages.. So in order to try and fix that issue I decided I should just write up a delayed javascript function to refresh the display.

 

Here is my javascript so far:

 

function RefreshChat()
{
   var Display = document.getElementById('Display');
   if(Display != null)
   {
      Display.src = "Chat.php&VarName=Value#Anchor";
   }
}

 

The HTML bit:

<iframe onload='setTimeout("RefreshChat()",9000);' src='Chat.php&VarName=Value#Anchor' name='Display' id='Display'></iframe>

 

thats all the code except for the chat.php page..but all that page does is takes the values in and outputs the messages

 

it does also contain the Anchor

 

<div id='Anchor' name='Anchor'></div>

 

 

Can any1 tell me why the function doesn't seem to want to fire more than one time? Even though after the first time it fires the iframe is loaded again?

What it feels like to me is that the browsers keep breaking my loop

Link to comment
https://forums.phpfreaks.com/topic/239733-looping-iframe-reload-need-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.