淡淡烟草味2017-05-19 10:26:59
1. If you are using popular frameworks, such as ng, react and vue, you can encapsulate it into a component;
2. If it is a classic HTML page, you can encapsulate the query box and related ajax processing into a sub-page and introduce it with an iframe ; Or encapsulated into a js file, and the html part is generated by js.
淡淡烟草味2017-05-19 10:26:59
Create a search.js
Write everything in DOM into js, wouldn’t it be great
为情所困2017-05-19 10:26:59
Cache the first query result to sessionStorage, and then obtain it directly from sessionStorage