Home > Web Front-end > HTML Tutorial > How should I write this code? About calling js_html/css_WEB-ITnose

How should I write this code? About calling js_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:55:29
Original
956 people have browsed it

If the content of xxx.js is

document.writeln("<iframe src=\"http://www.xxx.com\" ></iframe>");
Copy after login

, the call in HTML is usually
<script src="/xxx.js" type="text/javascript"></script>
Copy after login


How to use
<p id="xxx"></p>
Copy after login

or
<div id="xxx"></div>
Copy after login

Or other methods, in short, don’t use <script src="/xxx.js" type="text/javascript"></script>.


Reply to discussion (solution)

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

Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template