티스토리 뷰
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title> Scope</title>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR" />
<script type ="text/javascript" src="global.js">
</script>
<script type="text/javascript" src="global2.js">
</script>
<script type="text/javascript">
message = "I'm in the page";
function testScope() {
message += " called in testScope()";
alert(message);
}
</script>
</head>
<body onload="testScope();global2Print();globalPrint()">
<script type = "text/javascript">
message += " embedded in page";
document.writeln(message);
</script>
</body>
</html>
'Study > 자바스크립트' 카테고리의 다른 글
[예제 1-3] 자바스크립트를 지원하지 않는 브라우저를 고려한 noscript 태그의 사용 예 (0) | 2011.01.19 |
---|---|
[예제 1-2] 자바스크립트를 body 안에 삽입하는 경우 (0) | 2011.01.13 |
자바스크립트로 할 수 있는 것들 (0) | 2011.01.13 |
[예제 1-1] 자바스크립트 코드를 head 태그 안에 넣은 예 (0) | 2011.01.13 |