If the content of xxx.js is
document.writeln("<iframe src=\"http://www.xxx.com\" ></iframe>");
<script src="/xxx.js" type="text/javascript"></script>
<p id="xxx"></p>
<div id="xxx"></div>
I don’t understand what you mean
Reference: load scripts asynchronously
Use the above page A certain method is then triggered in a certain event of p or div, such as click
I’m confused, what are you doing?
Anyway, you want to reference the .js file in your page You have to use