AJAX

L

lak

I am having an XML file that contains some records.
I need to parse that file and display the records in the form of
table.
If I change the file, i.e. if I modified some contents in the XML
file, that needs to be updated in the table automatically.

For example:
XML file:
<?xml version="1.0"?>
<student>
<record>
<Name>XXX</Name>
<Mail>[email protected]</Mail>
</record>
<record>
<Name>YYY</Name>
<Mail>[email protected]</Mail>
</record>
<student>

I need to display this in the form of table. I use the PHP xml parser
to parse this and I displayed that in the table.

Now my requirement is if the XXX is changed to GGG, then I need to
update the front end immediately using AJAX. I don't need to refresh
the page. I just need to update the XXX to GGG.

How can I do that?
Pls help!
 
D

David Mark

I am having an XML file that contains some records.
I need to parse that file and display the records in the form of
table.
If I change the file, i.e. if I modified some contents in the XML
file, that needs to be updated in the table automatically.
Okay.


For example:
XML file:
<?xml version="1.0"?>
<student>
  <record>
    <Name>XXX</Name>
    <Mail>[email protected]</Mail>
  </record>
  <record>
    <Name>YYY</Name>
    <Mail>[email protected]</Mail>
  </record>
<student>

I need to display this in the form of table. I use the PHP xml parser
to parse this and I displayed that in the table.

Now my requirement is if the XXX is changed to GGG, then I need to
update the front end immediately using AJAX. I don't need to refresh
the page. I just need to update the XXX to GGG.

How can I do that?

This sounds suspiciously like a homework assignment.
Pls help!

No, I don't think I will.
 
D

David Mark

So that's all done on the server side.


You can't just push data from the server to the client, the client has
to request it (pull). This is usually done by polling the server at
regular intervals (using window.setTimeout). For example, you could read
the complete XML file every 5 seconds with XHR, compare the new data to
what's in the table, and update the HTML as needed. That would be the
easiest way.

A more elegant (but also more complicated) alternative would be to write
a little web service (PHP script) that sends only a change set.




No, of course you don't,
You'd rather insult people.

Perhaps you should re-read my post. (?)
You are just a troll.

Little haiku from me ;-)

Don't quit your day job (whatever that might be.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,990
Messages
2,570,211
Members
46,796
Latest member
SteveBreed

Latest Threads

Top