The specific situation is as follows:
Before the page is fully loaded, a mouse click triggers a script event that generates an iFrame.
First of all, I thought of dynamically adding the script event to the triggering position after the page is fully loaded. In this way, there will be no script event here before the page is fully loaded, and naturally no error will be reported.
The above method is a bit passive, so I went to see the script for generating iframe.
The normal page structure is