Because I didn’t understand Jquery at first, I always wanted to use the jquery.load method to load a new page to achieve partial refresh. It turned out that the loaded page was different from the original separate page, and the style was gone. Later I checked it online. , I found a solution, this is someone else’s answer:
is like this, if you don’t filter out some content and load it directly, the page will be confused. For example, the new page also has the
tag. , after loading, a page will have two HTML tags with non-standard . This is specified in the jquery.load() function. Generally, the loaded page needs to redefine the CSS style and add js events according to the elements of the loaded content. For example:
Original page A.html:
< ;html>
The loaded page B.html:
- 234123
- 341234
- 41234
- 412de34 li>
Load the called jquery.load( in the original page A.html ), and then redefine the style of page-li on the original page:
Added load(), the original page of css:
< div id="container">