Thursday, October 2, 2008

[jQuery] Basic AJAX Q: how to replace current with XHR-fetched page?

This is the most basic AJAX question.  Suppose my script fetches a new page using $.( 'http://some/url', ... ).  I'd now like to replace the currently displayed page with the newly fetched one.  I suppose that I need to make a new DOM subtree from the downloaded content and replace the subtree corresponding to the current page with this newly generated subtree...  But I'm not sure of how one does this.

Could someone show me how to do this?  (Or point me to an example?)

TIA!

Kynn

No comments: