티스토리 뷰
자바스크립트에서 가장 대표적인 디버깅 함수가 alert와 console.log이다.
이클립스에서 js를 진행했다.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>자바스크립트 기초</title>
<script type="text/javascript">
alert("Hello World")
</script>
</head>
<body>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>자바스크립트 기초</title>
<script type="text/javascript">
alert("Hello World");
console.log("Hello World!!");
</script>
</head>
<body>
</body>
</html>
F12누른 후 콘솔 창을 본다.
자바스크립트는 웹브라우저가 해석하는 것이다.
jsp처럼 서버(tomcat)가 해석하는 것이 아니다.
자바스크립트 출력방법:
첫 번 째 방법: show in > system explore > html파일 클릭
두 번 째 방법: http://localhost:8282/jsp_javascript/hellojs.html
'JavaScript' 카테고리의 다른 글
Functions (0) | 2022.04.11 |
---|---|
Data Types, Operators(데이터 타입과 연산자) (0) | 2022.04.11 |
JavaScript for Beginner (0) | 2022.04.11 |
[자바스크립트] vscode 활용한 변수 선언, 문자열, 숫자 (0) | 2021.12.13 |
[자바스크립트] vscode 활용한 변수 선언, alert, console (0) | 2021.12.13 |
댓글