Print Page | Close Window

No blink refresh

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: General Discussion
Forum Description: General discussion and chat on any topic.
URL: https://forums.webwiz.net/forum_posts.asp?TID=7115
Printed Date: 30 March 2026 at 9:38am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: No blink refresh
Posted By: Gullanian
Subject: No blink refresh
Date Posted: 09 November 2003 at 7:49am
Im looking to refresh data in an IFrame or textbox using javascript without it blinking constantly!  Does anyone know how to achieve this?



Replies:
Posted By: Mart
Date Posted: 09 November 2003 at 7:57am
Its not possible! I tried everything. I was making a chat app, in the end i just used flash (well swish max).


Posted By: Gullanian
Date Posted: 09 November 2003 at 8:04am

Someone told me you could get an iframe and a textbox, make the iframe hidden, keep refreshing the iframe, then use JS to retrieve the data from the iframe into the textbox.

Anyone know how to do this?



Posted By: Flamewave
Date Posted: 10 November 2003 at 11:08am
You could probally do the same thing using a html div and the innerHTML javascript command, and it would probally look a lot nicer then using textbox too.

-------------
- Flamewave

They say the grass is greener on the other side, but if you really think about it, the grass is greener on both sides.


Posted By: Gullanian
Date Posted: 10 November 2003 at 12:38pm
Anyone got any code examples of how to achieve this


Posted By: Flamewave
Date Posted: 10 November 2003 at 12:51pm

<iframe id="refreshframe"></iframe>
<div id="newcontent"></div>
<script>
flip_div('refreshframe', 'newcontent');
function flip_div(sorce,target)
{
//code to refresh the iframe goes here

//set the innerhtml of the div to the iframe contents

document.getElementById(target).innerHTML = document.getElementById(sorce).innerHTML;
}
</script>

Something along those lines should do the trick. You may need to tweak it a bit to get it to work with iframes, as I've only used this to go between divs, then you'll just have to set a javascript timer to execute the function every so often.



-------------
- Flamewave

They say the grass is greener on the other side, but if you really think about it, the grass is greener on both sides.


Posted By: Gullanian
Date Posted: 10 November 2003 at 2:52pm
Thank you very much, will be trying it out later.  I need to learn javascript!


Posted By: pmormr
Date Posted: 10 November 2003 at 4:01pm
me 2

-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/


Posted By: Gullanian
Date Posted: 10 November 2003 at 4:52pm


<IFRAME SRC="chatBox.asp" width="0" height="0" name="refreshframe"></iframe>

<div id="newcontent"></div>

<SCRIPT language = "JavaScript">

<!--

function flip_div(sorce,target)

{

//code to refresh the iframe

parent.refreshframe.history.go(0);

//set the innerhtml of the div to the iframe contents

document.getElementById(target).innerHTML = document.getElementById(sorce).innerHTML;

}

var the_count = 0;

var the_timeout;

function doTimer() {

flip_div('refreshframe', 'newcontent');

the_count += 2;

the_timeout = setTimeout("doTimer();", 2000);

}

//-->

</SCRIPT>

Hmm...... it doesnt add the data to the <div>, anyone help me out on this one?

Its works 100% fine except it cant get the data from the iframe



Posted By: Gullanian
Date Posted: 10 November 2003 at 5:05pm

SORTED!

For anyone that wants the code that works, here ya go:


<IFRAME SRC="chatBox.asp" width="0" height="0" id="refreshframe"></iframe>

<div id="newcontent"></div>

<SCRIPT language = "JavaScript">
<!--
function flip_div(sorce,target)
{
  parent.refreshframe.history.go(0);
  document.getElementById(target).innerHTML =
 refreshframe.document.body.innerHTML;
}

var the_count = 0;
var the_timeout;

function doTimer() {
  flip_div('refreshframe', 'newcontent');
  the_count += 2;
  the_timeout = setTimeout("doTimer();", 2000);
}

//-->
</SCRIPT>




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net