How to replace the entire html webpage with ajax response?

前端 未结 6 690
难免孤独
难免孤独 2020-12-01 18:38

Before going to the specific question I need to explain a few basic steps.

First, the application in question deals with the management of appointments online by cus

6条回答
  •  温柔的废话
    2020-12-01 19:03

    this question has already been treated here: Replace HTML page with contents retrieved via AJAX

    Basically, you may try (My bad this is not working on IE):

    document.open();
    document.write(newContent);
    document.close();
    

    or, since you are using jquery

    $("body").html(data);
    

    Regards

提交回复
热议问题