IFrame cross-domain Suppose you have two pages, a.haorooms.com/text.html and b.haorooms.com/text.html, To modify local data on b.haorooms.com/text.html, go to a.haorooms.com/text.html.

① Create an iframe on a.haorooms.com/text.html and embed it in b.haorooms.com/text.html. ② The a.haorooms.com/text.html page sends a message in a specified format to the b.haorooms.com/text.html page through postMessage. ③ the b.haorooms.com/text.html page parses the message content from the a.haorooms.com/text.html page and invokes localStorage API to operate local data. ④ The b.haorooms.com/text.html page packages the operation result of localStorage and sends it to a.haorooms.com/text.html through postMessage. ⑤ the a.haorooms.com/text.html page parses the message sent by b.haorooms.com/text.html to obtain the operation result of localStorage.Copy the code

This Cookie cross domain solution (IFrame cross domain) introduction is complete.