How to share data among multiple html pages in a traditional multi-page project? (multiple pages involve cross-domain)

  1. how do you share data among multiple html pages in a traditional multi-page project? (multiple pages involve cross-domain)
Mar.12,2021

this kind of problem does not need to think about must be done by the back end, which is saved and distributed as the top level of your application. Cross-domain not cross-domain, multi-page spa can achieve your needs. The data to be shared is placed on the server.

forget about jsonp cross-domain local storage at the front end. On the contrary, it is difficult to maintain.


Cross-domain data sharing?


is implemented through the background interface, and a single api is used to transfer data between different pages


jsonp
window.name

html5 postMessage


background storage or the front end uses LocalStorage


to cross-domain and share data, so you might as well open an API to implement it.

Menu