iframe solves the fallback problem caused by multiple child pages of a parent page

When I was working on the project, I found that when the parent page uses an iframe embedded page, for example, the parent page has a tab, click different tabs to switch the content of the tab, at this time, each different tab content is an html page.

When you click the tab multiple times and click the browser back button, the page does not roll back, and only the history page of the iframe is rolled back, and the previous page cannot be returned until the initial historical iframe is rolled back.

At this point, I use the src link to replace the iframe for content switching.

For the above problems, just replace the entire iframe.

The following html:

iframe placement area:

Use js for whole iframe replacement:

 

type is the page value.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326191660&siteId=291194637