By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,067 Members | 1,849 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,067 IT Pros & Developers. It's quick & easy.

Echoing from a Script

P: n/a
hi guys,

well basically I am writing a simple routing script. It reads data
from an XML and from a PostgreSQL.

Some of the data is being randomized, and every now and then some data
is echoed in the background.

Is there a way to have the script, using XMLHTTPResponse (AJAX), to
make this :
- Run the script in the background

- Whenever the script echo's soemthing it echoes to the main <divI
want it to

- The new echo should replace the prior echo

- The echo should be real time / live

- The echo can not be saved in a Javascript function and parsed to the
user one by one

The script which echo's data is already done via PHP and can be
accessed here : http://yancho.no-ip.org/~yancho/xml_parser.php

As you can see it echo's randomly (basically before reading each XML
edge, it waits 10 seconds, but then, since sometimes it compares and
fails, and has to compare again, it waits another 2 seconds.

That means that the looping cannot be done in javascript, and has to
be done on the PHP script.

On my php script, at the moment I am using this : http://yancho.pastebin.com/f4b4b4b11

Any suggestions on which AJAX methods I need to read into and which
PHP alterations are needed will extremely help me please.

Thanks alot!!

Matthew
Dec 16 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
I believe what you want to accomplish is "server push", whereas
conventional web techniques are based on client pull. If there's a
real non-exotic implementation of that it's news to me. The belief
that AJAX provides it is a common error, IMO.

Google for that phrase and you'll see what I mean.

AS
Dec 17 '07 #2

P: n/a
On Dec 16, 10:34 pm, ashore <shor...@gmail.comwrote:
I believe what you want to accomplish is "server push", whereas
conventional web techniques are based on client pull. If there's a
real non-exotic implementation of that it's news to me. The belief
that AJAX provides it is a common error, IMO.

Google for that phrase and you'll see what I mean.

AS
There's the multipart/x-mixed-replace mime type. It works really well
-- but it isn't supported by all browsers (including IE).
Dec 17 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.