Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.