Hi, I am using HTMLHTTPREQUEST and I have edited it to suit my needs: I needed to exchange HTML snippets between server and client, no complex DOM handling.
I have edited the component and I have made the following changes/improvements:
- all data is packed through htmlentities() (PHP function
http://php.net/rawurlencode ) into an XML wrapper with a proper CDATA section (data is safely exchanged as XML compliant);
- IE7 support through emission of rawurlencoded() RFC 1738 data packed into the same XML wrapper (explorer is tricky with HTML data
http://stud3.tuwien.ac.at/~e0226430/innerHtmlQuirk.html and javascript lacks of HtmlDecode() function, this way the best solution is to use the core unescape() function of javascript and to supply properly encoded data from the server);
- data is returned as xmlhttp.responseText when possible, so that the HTML snippet can be directly extracted;
- removed submitInto(), addEvent() and other functions to use only the core Transport layer (I like light-weight ;)
Note: I have not used data submission through Ajax because _it is not a good practice_...
Note 2: btw, the example is not working on IE7...you may consider adding some compatibility fixes, even if I do not use that browser and personally don't care if you do ;)
Note 3: I have had troubles accessing the XML DOM under the same buggy browser named above; does somebody have a working snippet to access the first node in all IE5+ versions ?
Note 4: there is some problem with the *smart* XmlHttp manager since it does not actually work under IE seven.
I found this cross-browser component very good! As soon as I release my FOSS project I will send you a note.
Thanks
Love is like life, until it lasts everything goes right...