473,320 Members | 2,098 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Echoing from a Script

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
2 1294
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: TheKeith | last post by:
I'm just learning php and set up a sample mysql db to practice with. I have the following script and cannot for the life of me figure out why it is printing each field of the row twice? I checked...
6
by: Mike Daniel | last post by:
I am attempting to use document.write(pageVar) that displays a new html page within a pop-up window and the popup is failing. Also note that pageVar is a complete HTML page containing other java...
3
by: Water Cooler v2 | last post by:
Questions: 1. Can there be more than a single script block in a given HEAD tag? 2. Can there be more than a single script block in a given BODY tag? To test, I tried the following code. None...
2
by: bilaribilari | last post by:
Hi all, I am using Tidy (C) for parsing html pages. I encountered a page that has some script as follows: <script> .... var abc = "<script>some stuff here</" + "script>"; .... </script>
3
by: vorange | last post by:
Hello, I have a problem I have been unable to solve for quite some time now. I'm using the Serialport class and opening the port and writing a byte to it. The byte is successfully received by...
19
by: thisis | last post by:
Hi All, i have this.asp page: <script type="text/vbscript"> Function myFunc(val1ok, val2ok) ' do something ok myFunc = " return something ok" End Function </script>
3
by: rsteph | last post by:
I have a script that shows the time and date. It's been working on my site for quite a while now. Suddenly it stops showing up, after getting my drop down menu to work. If I put text between the...
2
by: Matthew Pulis | last post by:
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...
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.