<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="utf-8">
<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame
Remove this if you use the .htaccess -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>callback_sample_01</title>
<meta name="viewport" content="width=device-width; initial-scale=1.0">
<!-- Replace favicon.ico & apple-touch-icon.png in the root of your domain and delete these references -->
<link rel="shortcut icon" href="/favicon.ico">
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
<script type="text/javascript">
var each = function(arr, callback) {
for(i = 0; i < arr.length; i++) {
callback.prototype = arr[i];
new callback(i);
}
document.getElementById('txtName').focus();
};
onload=function() {
var test = [ { name : 'a' }, { name : 'b' }, { name : 'c' } ];
each(test, function(index) {
alert(index + " = " + this.name);
});
};
</script>
</head>
<body>
<div>
<header>
<h1>callback_sample_01</h1>
</header>
<nav>
<p>
<a href="/">Home</a>
</p>
<p>
<a href="/contact">Contact</a>
<input type="text" id="txtName" name="name"/>
</p>
</nav>
<div>
</div>
<footer>
<p>
© Copyright by
</p>
</footer>
</div>
</body>
</html>
댓글 없음:
댓글 쓰기