Developing with DOM and XMLHttpRequest

This is a discussion on Developing with DOM and XMLHttpRequest within the PHP Language forums, part of the PHP Programming Forums category; Hi, I have to write a web program (not a web site) and I was exploring all possibilities. When I ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-10-2004
RCarter
 
Posts: n/a
Default Developing with DOM and XMLHttpRequest

Hi,
I have to write a web program (not a web site) and I was exploring all
possibilities.
When I found XMLHttpRequest I decided to use it.
I'm interesting also in DOM, and I formuled this idea of a PHP framework:

for every page of the program:

- an XML file where there are all the static parts, and where the
dynamic part have to go (after a DB query, etc.) you put something like
<div id="where_the_table_have_to_go"></div>

- a .php file that initialize the dynamic data of the page, created with
DOM objects and with something like that (I don't know the correct
syntax, it's only an idea):

$doc = new DOMDocument("file.xml");
// DB query and $table creation with DOMElement and so on...
// and finally
$panel = $doc->getElementsByTag("where_the_table_have_to_go");
$t = $panel->createTextNode($table.saveHTML()); // I don't know if
TextNode is correct :)
$panel->appendChild($t);

- a .php file with the right Javascript code to use XMLHttpRequest.
When in the browser a change occours, the JS function call this file
to upgrade the desired node of the page. Finally he answers with
something like:

creatTextNode($table.saveHTML());

Is all that possible? Anyone knows if there are some libraries that uses
DOM and XMLHttpRequest together?
Is it possible to update only a node of a page with XMLHttpRequest?

Thank you a lot
--
RCarter
Reply With Quote
  #2 (permalink)  
Old 12-10-2004
DrTebi
 
Posts: n/a
Default Re: Developing with DOM and XMLHttpRequest

On Fri, 10 Dec 2004 16:03:41 +0000, RCarter wrote:

> Hi,
> I have to write a web program (not a web site) and I was exploring all
> possibilities.
> When I found XMLHttpRequest I decided to use it.
> I'm interesting also in DOM, and I formuled this idea of a PHP framework:
>
> for every page of the program:
>
> - an XML file where there are all the static parts, and where the
> dynamic part have to go (after a DB query, etc.) you put something like
> <div id="where_the_table_have_to_go"></div>
>
> - a .php file that initialize the dynamic data of the page, created with
> DOM objects and with something like that (I don't know the correct
> syntax, it's only an idea):
>
> $doc = new DOMDocument("file.xml");
> // DB query and $table creation with DOMElement and so on...
> // and finally
> $panel = $doc->getElementsByTag("where_the_table_have_to_go");
> $t = $panel->createTextNode($table.saveHTML()); // I don't know if
> TextNode is correct :)
> $panel->appendChild($t);
>
> - a .php file with the right Javascript code to use XMLHttpRequest.
> When in the browser a change occours, the JS function call this file
> to upgrade the desired node of the page. Finally he answers with
> something like:
>
> creatTextNode($table.saveHTML());
>
> Is all that possible? Anyone knows if there are some libraries that uses
> DOM and XMLHttpRequest together?
> Is it possible to update only a node of a page with XMLHttpRequest?
>
> Thank you a lot


I am quite sure it's possible, although to me it seems complicated, and,
you are completely relying on the fact that a) the user has a browser with
javascript enabled, and b) that the user has a browser that even
understands XMLHttpRequest.

Anyway, you should google a bit for this, I found this page for example:
http://www.webpronews.com/webdevelop...POnTheFly.html

DrTebi


Reply With Quote
  #3 (permalink)  
Old 12-11-2004
Tim Van Wassenhove
 
Posts: n/a
Default Re: Developing with DOM and XMLHttpRequest

In article <xNjud.14424$Lg7.474726@twister1.libero.it>, RCarter wrote:
> Is all that possible? Anyone knows if there are some libraries that uses
> DOM and XMLHttpRequest together?


Might want to have a look at http://jpspan.sf.net




--
Met vriendelijke groeten,
Tim Van Wassenhove <http://www.timvw.info>
Reply With Quote
  #4 (permalink)  
Old 12-11-2004
Chung Leong
 
Posts: n/a
Default Re: Developing with DOM and XMLHttpRequest

"RCarter" <rcarter@despammed.com> wrote in message
news:xNjud.14424$Lg7.474726@twister1.libero.it...
> Is all that possible? Anyone knows if there are some libraries that uses
> DOM and XMLHttpRequest together?
> Is it possible to update only a node of a page with XMLHttpRequest?


It is certainly possible. On the other hand, it's also possible to translate
the Klingon edition of Hamlet back into English. Why on earth would you want
to do it, that's the question.


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 09:23 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0