JavaScript
[자바스크립트] 이클립스를 활용한 alert, console.log
praybe
2021. 12. 13. 15:17
자바스크립트에서 가장 대표적인 디버깅 함수가 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