Web Analytics Made Easy -
StatCounter I need to refresh just one DIV inside a HTML without refreshing the whole page - CodingForum

Announcement

Collapse
No announcement yet.

I need to refresh just one DIV inside a HTML without refreshing the whole page

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • I need to refresh just one DIV inside a HTML without refreshing the whole page

    Hey!

    So what I need is probably called AJAX-tech 'em I right?

    So the case is that I have a simple chat on a web page, but It wont refresh
    itself unless the user refrehes the whole page, and thats kind of silly and I
    cannot force the page to totally refresh itself cause that would mess up
    the other things the user can do on the site. So I would need to make the
    DIV to "load itself again in for example 3sec".

    I belive this is quite common thing to construct, and Im hoping for if someone
    could point me to a place which contains how to construct this or If you
    personally have recently done so you can help me out easly then =)

    Thanks in advance.

  • #2
    Yes, AJAX is *ONE* answer.

    But...

    But you might think about a much simpler answer: Put the "conversation" into an <IFRAME> and simply reload the iframe periodically! You can even do that via a META-REFRESH in the code for the iframe (remember, that code is a completely independent HTML page, so it can use independent META settings along with independent JavaScript). Presto. Instant chat. The easiest possible way.

    But if you opt to go the AJAX route, there are literally thousands and thousands of examples out there. Remember, you need to write cross-browser code, but most such examples will do so.
    Be yourself. No one else is as qualified.

    Comment


    • #3
      Thanks for the tip, but after testing the iframe-method I decided to go with ajax.
      It isnt that smooth with the meta-refresh even if it is in another frame

      Comment

      Working...
      X