Forum Moderators: open

Message Too Old, No Replies

AJAX Technology

         

Kman

5:28 pm on Jan 10, 2006 (gmt 0)

10+ Year Member



Is there code available that would update a page in real-time? The visitor wouldn't have to refresh the page, the content on the page would update itself

This would be done using AJAX.

Anyone have the code to do this?

MatthewHSE

6:55 pm on Jan 10, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If I'm understanding correctly, this is done all the time. However, I'm pretty sure it requires some form of user input.

What are you trying to do?

Kman

9:49 pm on Jan 10, 2006 (gmt 0)

10+ Year Member



I'm trying to provide visitors updates in real-time. The updates would change similar to Digg Spy [digg.com].

Any ideas on the code to do this?

Thanks.

aspdaddy

9:56 pm on Jan 10, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Not real time. It uses xmlhttp.open on a javascript timer to pull new content down.

icpooreman

4:50 am on Jan 11, 2006 (gmt 0)

10+ Year Member



well it's impossible to get completely real time because ajax only allows the client to request from the server and not the other way around. Although you can get fairly close by just constantly requesting info from the server although is impractical sometimes.

Kman

7:09 pm on Jan 11, 2006 (gmt 0)

10+ Year Member



I would like to update and deliver content quickly. Is the ajax method the way to do this?

And if so, are there available scripts?

icpooreman

2:54 pm on Jan 12, 2006 (gmt 0)

10+ Year Member



if you're looking to autorefresh the page every few seconds then you can definitely do that with AJAX. I don't know if there are any prewritten scripts available that would just do what you're looking for. If you're looking to code it yourself though I think this is one of the better begginners tutorials I found when I was trying to learn how to implement it [xml.com...]

Kman

10:27 pm on Jan 12, 2006 (gmt 0)

10+ Year Member



That's great!

Thank you for the tutorial!

whoisgregg

10:45 pm on Jan 12, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ugh, it's a tutorial of a tutorial. The original (much shorter and very clear on it's own) is Dynamic HTML and XML: The XMLHttpRequest Object [developer.apple.com] on Apple's site.

dnb_ovst

5:01 am on Jan 15, 2006 (gmt 0)

execute

12:12 am on Jan 17, 2006 (gmt 0)

10+ Year Member



AJAX POST Tutorial [designplanet.biz]
AJAX GET Tutorial [designplanet.biz]

This might help you. All you do is add a setTimeInterval, just google that function and find out how to use it, then use it to call the AJAX function every interval.

It makes a loop.
You can also make a for() loop and loop the AJAX() function.