본문 바로가기

HTML

script 태그

script태그는 클라이언트 측 스크립트(자바스크립트)를 작성하거나 외부 스크립트 파일을 연결할 때 사용한다.

 

<!DOCTYPE html>
<html>
	<head>
		<title>SCRIPT</title>
		<script type="text/javascript">
			alert("script");
		</script>
		<script type="text/javascript" src="script.js"></script>
	</head>
	<body>

	</body>
</html>
HTML

 

Attribute Value Description
async async 외부 파일 연결시 비동기 연결 설정
crossorigin anonymous
use-credentials
Sets the mode of the request to an HTTP CORS Request
defer defer 외부 파일 연결시 HTML문서의 파싱 후 실행 설정
integrity filehash 외부 파일의 무결성 체크 설정
nomodule True
False
Specifies that the script should not be executed in browsers supporting ES2015 modules
referrerpolicy no-referrer
no-referrer-when-downgrade
origin
origin-when-cross-origin
same-origin
strict-origin
strict-origin-when-cross-origin
unsafe-url
Specifies which referrer information to send when fetching a script
src URL Specifies the URL of an external script file
type scripttype Specifies the media type of the script

 

반응형

'HTML' 카테고리의 다른 글

abbr 태그  (0) 2021.01.01
noscript 태그  (0) 2020.12.31
meta 태그  (0) 2020.12.29
link 태그  (0) 2020.12.28
base 태그  (0) 2020.12.28