Because I use shtml, I used include directly in the page to load the advertisement. If you are interested in shtml, please see: shtml moving html
The same code is used to introduce js. img_failed.innerHTML = Just replace it with the JS you call later (not tested);
Also worth noting is that img_failed.innerHTML = The latter thing will directly display html. If your html has "(double) If quotation marks), please change it to '(single quotation marks), or just don't add it. Otherwise, problems will occur.
For details, you can compare the following two links: