$.extend() 메서드 : 객체 생성 후 속성 추가
<html>
<head>
<meta charset="utf-8"/>
<script src="/ajaxjquery/jquery-1.10.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var obj = { name : "OnJ" };
$.extend(obj, {
age:"7",
addr:"Guro Kolon2"
});
var out;
$.each(obj, function (key, item) {
out += key + ":" + item + "\n";
});
alert(out);
});
</script><body> </body> </html>
age:"7",
addr:"Guro Kolon2"
});
var out;
$.each(obj, function (key, item) {
out += key + ":" + item + "\n";
});
alert(out);
});
</script><body> </body> </html>
댓글 없음:
댓글 쓰기