On Jan 7, 3:46 am, howa <[EMAIL PROTECTED]> wrote: > I have been following John's > article:http://ejohn.org/blog/bringing-the-browser-to-the-server > > The script only support well formed XML, as defined in the function > (env.js) > > window.__defineSetter__("location", function(url){ > var xhr = new XMLHttpRequest(); > xhr.open("GET", url); > xhr.onreadystatechange = function(){ > curLocation = new java.net.URL( curLocation, url ); > window.document = xhr.responseXML; > > var event = document.createEvent(); > event.initEvent("load"); > window.dispatchEvent( event ); > }; > xhr.send(); > }); > > But why we need fetch valid XML?
You don't have to use XML for sure, you can use JSON and fetch Javascript data structures from the server-side. I think it's often much easer for a server-side developer.. or you can just "load" plain html text into your DOM tree(usually into a single field). lihao(XC)