The <script> Tag
In HTML, JavaScript code must be inserted between <script> and </script> tags.
html 안에서 자바스크립트 코드는 <script> 과 </script> 태그 사이에 삽입되어야만 한다.
Old JavaScript examples may use a type attribute: <script type="text/javascript">.
The type attribute is not required. JavaScript is the default scripting language in HTML.
오래된 자바스크립트 예제는 <script type="text/javascript"> 를 사용할지도 모른다.
타입 속성은 요구되지 않는다.
자바스크립트는 html 안에서 기본적으로 스크립팅 되는 언어이다?
JavaScript Functions and Events
A JavaScript function is a block of JavaScript code, that can be executed when "called" for.
For example, a function can be called when an event occurs, like when the user clicks a button.
자바스크립트 함수와 이벤트
자바스크립트 함수는 JavaScript code의 한 블록이다.
그것은 호출됨으로써 실행되어질 수 있다.
예를들면 함수는 이벤트가 실행되어질때, 호출되어질 수 있다.
유저가 버튼을 클릭할때와 같이.
JavaScript in <head> or <body>
You can place any number of scripts in an HTML document.
Scripts can be placed in the <body>, or in the <head> section of an HTML page, or in both.
head 혹은 body 안에서의 자바스크립트
너는 html 문서 안에 어떤 곳에서든 위치시킬수 있다.
스크립트는 <body>안에 위치 되어야만한다.
혹은 head 섹션 안에
JavaScript in <head>
In this example, a JavaScript function is placed in the <head> section of an HTML page.
The function is invoked (called) when a button is clicked:
예제에서 자바스크립트 함수는 html page head 섹션에 위치해있다.
함수는 버튼을 클릭되어질때, 실행되어진다.
JavaScript in <body>
In this example, a JavaScript function is placed in the <body> section of an HTML page.
The function is invoked (called) when a button is clicked:
예제안에서 자바스크립트 함수는 body 섹션안에 위치해있다.
함수는 버튼이 툴러질때, 실행되어진다.
Placing scripts at the bottom of the <body> element improves the display speed, because script interpretation slows down the display.
body 요소 아래에 스크립트를 위치시키는 것은 디스플레이 속도를 향상시킨다. 왜냐하면, 스크립트의 해석은 디스플레이의 속도를 늦춘다.
External JavaScript
Scripts can also be placed in external files:
스크립트는 외부의 파일안에 위치해질수 있다.
External scripts are practical when the same code is used in many different web pages.
JavaScript files have the file extension .js.
To use an external script, put the name of the script file in the src (source) attribute of a <script> tag:
외부의 파일은 많은 웹페이지에서 같은 코드가 사용되어질때, 실용적이다.
자바스크립트 파일은 확장자 js를 가진다.
외부의 파일을 사용하기 위해선, 스크리브의 파일의 이름을 script 태그 안의 src에 넣어라.
You can place an external script reference in <head> or <body> as you like.
The script will behave as if it was located exactly where the <script> tag is located.
head, 혹은 body 안에 외부 스크립트 레퍼런스를 놓을 수 있다.
마치 이 스크립트가 정확히 <script> 태그 안에 위치해 잇는 것처럼 행동할 것이다.
External JavaScript Advantages
Placing scripts in external files has some advantages:
- It separates HTML and code
- It makes HTML and JavaScript easier to read and maintain
- Cached JavaScript files can speed up page loads
To add several script files to one page - use several script tags:
외부 자바스크립트 의 이점
외부에 자바스크립트를 위치해놓는 것은 몇가지 이점을 가지고 있다.
1. html과 코드를 분리한다.
2. html 과 javascript를 더 읽기 쉽게 유지하기 쉽게 만든다.
3. 캐시된 자바스크립트 파일은 페이지 로드를 올려준다.
하나의 페이지에 스크립트 파일을 추가하기 위해, 몇몇의 스크립트 태그를 사용하라?
'영어공부' 카테고리의 다른 글
JavaScript Statements (0) | 2020.01.23 |
---|---|
JavaScript Output (0) | 2020.01.23 |
JavaScript Introduction (0) | 2020.01.23 |
JavaScript Tutorial (0) | 2020.01.22 |
CSS Specificity (0) | 2020.01.21 |
The <script> Tag
In HTML, JavaScript code must be inserted between <script> and </script> tags.
html 안에서 자바스크립트 코드는 <script> 과 </script> 태그 사이에 삽입되어야만 한다.
Old JavaScript examples may use a type attribute: <script type="text/javascript">.
The type attribute is not required. JavaScript is the default scripting language in HTML.
오래된 자바스크립트 예제는 <script type="text/javascript"> 를 사용할지도 모른다.
타입 속성은 요구되지 않는다.
자바스크립트는 html 안에서 기본적으로 스크립팅 되는 언어이다?
JavaScript Functions and Events
A JavaScript function is a block of JavaScript code, that can be executed when "called" for.
For example, a function can be called when an event occurs, like when the user clicks a button.
자바스크립트 함수와 이벤트
자바스크립트 함수는 JavaScript code의 한 블록이다.
그것은 호출됨으로써 실행되어질 수 있다.
예를들면 함수는 이벤트가 실행되어질때, 호출되어질 수 있다.
유저가 버튼을 클릭할때와 같이.
JavaScript in <head> or <body>
You can place any number of scripts in an HTML document.
Scripts can be placed in the <body>, or in the <head> section of an HTML page, or in both.
head 혹은 body 안에서의 자바스크립트
너는 html 문서 안에 어떤 곳에서든 위치시킬수 있다.
스크립트는 <body>안에 위치 되어야만한다.
혹은 head 섹션 안에
JavaScript in <head>
In this example, a JavaScript function is placed in the <head> section of an HTML page.
The function is invoked (called) when a button is clicked:
예제에서 자바스크립트 함수는 html page head 섹션에 위치해있다.
함수는 버튼을 클릭되어질때, 실행되어진다.
JavaScript in <body>
In this example, a JavaScript function is placed in the <body> section of an HTML page.
The function is invoked (called) when a button is clicked:
예제안에서 자바스크립트 함수는 body 섹션안에 위치해있다.
함수는 버튼이 툴러질때, 실행되어진다.
Placing scripts at the bottom of the <body> element improves the display speed, because script interpretation slows down the display.
body 요소 아래에 스크립트를 위치시키는 것은 디스플레이 속도를 향상시킨다. 왜냐하면, 스크립트의 해석은 디스플레이의 속도를 늦춘다.
External JavaScript
Scripts can also be placed in external files:
스크립트는 외부의 파일안에 위치해질수 있다.
External scripts are practical when the same code is used in many different web pages.
JavaScript files have the file extension .js.
To use an external script, put the name of the script file in the src (source) attribute of a <script> tag:
외부의 파일은 많은 웹페이지에서 같은 코드가 사용되어질때, 실용적이다.
자바스크립트 파일은 확장자 js를 가진다.
외부의 파일을 사용하기 위해선, 스크리브의 파일의 이름을 script 태그 안의 src에 넣어라.
You can place an external script reference in <head> or <body> as you like.
The script will behave as if it was located exactly where the <script> tag is located.
head, 혹은 body 안에 외부 스크립트 레퍼런스를 놓을 수 있다.
마치 이 스크립트가 정확히 <script> 태그 안에 위치해 잇는 것처럼 행동할 것이다.
External JavaScript Advantages
Placing scripts in external files has some advantages:
- It separates HTML and code
- It makes HTML and JavaScript easier to read and maintain
- Cached JavaScript files can speed up page loads
To add several script files to one page - use several script tags:
외부 자바스크립트 의 이점
외부에 자바스크립트를 위치해놓는 것은 몇가지 이점을 가지고 있다.
1. html과 코드를 분리한다.
2. html 과 javascript를 더 읽기 쉽게 유지하기 쉽게 만든다.
3. 캐시된 자바스크립트 파일은 페이지 로드를 올려준다.
하나의 페이지에 스크립트 파일을 추가하기 위해, 몇몇의 스크립트 태그를 사용하라?
'영어공부' 카테고리의 다른 글
JavaScript Statements (0) | 2020.01.23 |
---|---|
JavaScript Output (0) | 2020.01.23 |
JavaScript Introduction (0) | 2020.01.23 |
JavaScript Tutorial (0) | 2020.01.22 |
CSS Specificity (0) | 2020.01.21 |