How can we change only inner part of a web page?

前端 未结 7 1095
说谎
说谎 2020-12-06 08:25

I am developing a web application, where headers and footers for all pages are the same. What I want to achieve, is to change only the part of the page between the header an

相关标签:
7条回答
  • 2020-12-06 09:07

    You need to make an AJAX request to the server. The server would answer with the HTML to "inject" between the header and the footer. And the AJAX callback hendler would replace the current content with the new one.

    All this is done for you by the shortcut load function from jQuery. See http://api.jquery.com/load/

    0 讨论(0)
提交回复
热议问题