.in") directly. That is, replace the $inBox on lines 20 and 31 with $(".out>.in"). The logic is correct. Update solution two: External"/> .in") directly. That is, replace the $inBox on lines 20 and 31 with $(".out>.in"). The logic is correct. Update solution two: External">
Home > Article > Web Front-end > Detailed introduction to inline and external calls of js
The inline and external calls of js are introduced in detail. Let’s take a look at them below.
If the above code (part of the code that implements the carousel image) is written inline in HTML, it will not work. An exception will occur. But if it is placed in an external js file and called in the head of html, an exception will occur (no error will be reported, but the carousel logic will be abnormal).
Solution: Do not use the global variable $inBox, but use $(".out>.in") directly. That is, replace the $inBox on lines 20 and 31 with $(".out>.in"). The logic is correct.
##Update
Solution two: The external js remains unchanged. When quoting in html, add defer="defer" to delay execution.
You can read another essay for the specific principles.
Solution 3: The external js remains unchanged. In HTML, just quote it at the end of the body.
The above is the detailed content of Detailed introduction to inline and external calls of js. For more information, please follow other related articles on the PHP Chinese website!