In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the relevant knowledge of "what is the application of javascript embedded and external chain". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
The basic Application of javascript embedded and Outer chain
The js language can be completely placed in the HTML language
But depending on the situation, it can be divided into embedded type and outer chain type.
When there is less js code, you can directly use embedded javascript through tags and related attributes
[xss_clean] ("This is a heading"); [xss_clean] ("
This is a paragraph.
")
But in large-scale projects and when there is a lot of javascript code, you need to use the outer chain.
When using outer chain, you need to create a new .js file first.
Put the javascript code that needs to be written in the file of 1245.js
There are three writing modes of JavaScript: inline, inline, outer chain 1, and inline.
Within the attributes of the html tag, the execution is triggered by the behavior. (rarely used)
2. Embedded type
Wrapped with script tags in the html file, the page opens and executes automatically. It's easy to use, but don't use large JS code. )
3. Outer chain type
Written in a separate js file, the src attribute of the script tag is introduced in the html file, and the page opens automatically. (recommended because there are various optimization methods)
Note: it is really rarely used in the industry, hardly at all. Embedded and outer chains cannot share the same script tag. The script tag of the outer chain can be placed anywhere in principle. The script attribute of the outer chain is src, not href, not href, not href.
This is the end of the content of "what is the application of javascript embedded and external chain". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.