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.
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.
Create a search.js
Write everything in DOM into js, wouldn’t it be great
Cache the first query result to sessionStorage, and then obtain it directly from sessionStorage