I am using an XMLHTTPRequest to fake a RESTful interface. After the response object returns data from the request, how can i present that to the user? For example, in a PUT request, the server actually responds with a full HTML page of data (in most cases), and i want to display this whole page to the client. Any idea how? I'm sure there is an answer out there, but my lack of JS knowledge has me running into a wall, probably due to poor JS terminology.
Note that i am not more than willing to use a modern JS suite such as DOJO or JQuery. Also, i am not really looking for an Ajax like effect. In fact, once a couple browsers support the proper HTML5 spec form methods (GET/POST/PUT/DELETE) i'll be dumping this JS hack for it.
Any help would be much appreciated!
Edit: Talking with others, two ideas were presented. One was to use an IFrame and shove the data in there. The other was to redirect to "data:text/html,"+xhr.responseText
, which works, but is ugly to the user. :/.. i may end up just giving up and hiding method arguments in the HTML Form (hidden input) and dealing with it server side because i simply have yet to see a good way to use JS to implement client side support for a RESTful interface.