Replace HTML page with contents retrieved via AJAX February 11, 2023 by Tarik The simplest way is to set the new HTML content using: document.open(); document.write(newContent); document.close();