0

I need it so badly I have been trying it from 3 days but still i cant go for it. The question is how do i refresh an iframe without refreshing entire page for every 2 seconds? I googled so many sites but none helped, All of the codes that I found ,they just flicker the browser window and I dont want it to be happened

some of the sites i googled and more

http://www.codingforums.com/showthread.php?t=168589

http://roshanbh.com.np/2008/09/free-ajax-chat-applications-php.html

but still im unable to get it can anyone kindly explain me with a sample code please?

update

I want an iframe because I want to write users message to an html file using php file concepts and also then display the html file to users by using it as an iframe, for every 2 seconds, So that it looks like chat box.

This was my idea about creating a chat box. I have choose an iframe because i wanted to use smileys in my chat box.Kindly try to help me.Thanks!

niko
  • 9,285
  • 27
  • 84
  • 131
  • I don't know how you are doing your 2 second timing, but I think this is the root cause of your flickering. iframes do not cause the whole screen to flicker on their own. – T9b Jan 10 '12 at 15:13

1 Answers1

0

Instead of using the iframe as a chat box, you can have the iframe be invisible and have the javascript on the page check the contents of the iframe (hopefully it's the same domain, to make things simple) and update a container on the page itself. Since the page doesn't need to reload, there won't be any flicker.

Explosion Pills
  • 188,624
  • 52
  • 326
  • 405
  • sorry could you expand your answer little more or any helpful tutorials? – niko Jan 10 '12 at 14:11
  • http://stackoverflow.com/questions/1264569/how-to-get-iframe-src-content-using-javascript explains how to get the source of an ` – Explosion Pills Jan 10 '12 at 14:13