{"id":22,"date":"2012-08-22T22:23:46","date_gmt":"2012-08-22T13:23:46","guid":{"rendered":"http:\/\/www.freesens.com\/x\/?p=22"},"modified":"2012-08-23T14:38:30","modified_gmt":"2012-08-23T05:38:30","slug":"function-call-function-apply","status":"publish","type":"post","link":"http:\/\/www.freesens.com\/x\/?p=22","title":{"rendered":"Function.call(), Function.apply()"},"content":{"rendered":"<p><a href=\"http:\/\/okjungsoo.tistory.com\/entry\/Functionapply\">http:\/\/okjungsoo.tistory.com\/entry\/Functionapply<\/a><\/p>\n<p><a href=\"http:\/\/www.java-samples.com\/showtutorial.php?tutorialid=829\">http:\/\/www.java-samples.com\/showtutorial.php?tutorialid=829<\/a><\/p>\n<p>\uc704\uc640 \uac19\uc740 \uc598\uae30\uac00 \uc788\uc73c\ub2c8, \uc9c1\uc811 \ucc3e\uc544\ubcf4\uace0;;;;<br \/>\n\ub0b4 \uacbd\uc6b0\uc5d0\ub294 \uc784\uc758\ub85c \uc0dd\uc131\ud55c Class instance\uc5d0\uc11c \uacf5\ud1b5\uc73c\ub85c \uac04\uacb0\ud558\uac8c ajax\ud638\ucd9c \uc218\ud589 \ud6c4 \ubc18\ud658\ub418\ub294 \uac12\uc5d0 \ub300\ud574\uc11c \ucc98\ub9ac\ud558\ub294 callback function\uc744 \uad6c\ud604\ud568\uc5d0 \uc788\uc5b4\uc11c&#8230;&#8230; callback function\uc744 Class \ub0b4\ubd80\uc5d0 \uad6c\ud604\ud558\uace0, ajax \ud638\ucd9c \ud6c4 \ud574\ub2f9 function\uc744 \uc2e4\ud589\ud558\uc5ec \ucc98\ub9ac\ud558\ub294\ub370 \uc0ac\uc6a9\ud568.<\/p>\n<p><!--more--><\/p>\n<p>TestClass = function() {<br \/>\nfn$ajax(url, data, this);<\/p>\n<p><span style=\"color: #0000ff;\">TestClass.prototype.ajaxCallback = function(data) {<\/span><br \/>\n<span style=\"color: #0000ff;\">\u00a0 \u00a0 \u00a0 \u00a0 \/\/ data[&#8216;\ubd88\ub77c\ubd88\ub77c&#8217;];<\/span><br \/>\n<span style=\"color: #0000ff;\">\u00a0 \u00a0 }<\/span><br \/>\n}<\/p>\n<p>function fn$ajax(url, data, <span style=\"color: #0000ff;\">callbackObj<\/span>) {<br \/>\n$.ajax({<br \/>\ntype : &#8220;POST&#8221;,<br \/>\nurl : url,<br \/>\ndata : data,<br \/>\ntimeout : &#8230;..<br \/>\nsuccess : \u00a0<span style=\"color: #0000ff;\">fn_callback<\/span><br \/>\n});<\/p>\n<p><span style=\"color: #0000ff;\">\u00a0 \u00a0 function fn_callback(data) {<\/span><br \/>\n<span style=\"color: #0000ff;\">\u00a0 \u00a0 \u00a0 \u00a0 callbackObj.ajaxCallback.call(null, data);<\/span><br \/>\n<span style=\"color: #0000ff;\">\u00a0 \u00a0 }<\/span><br \/>\n}<\/p>\n<p>\ub300\ucda9 \uc774\ub807\uc9c0\ub9cc&#8230;..\ub9c9\uc0c1 \uc4f8\ub54c\ub294 \ub610 \uae4c\uba39\uc744\ub4ef&#8230;.;;<\/p>\n","protected":false},"excerpt":{"rendered":"<p><a href=\"http:\/\/okjungsoo.tistory.com\/entry\/Functionapply\">http:\/\/okjungsoo.tistory.com\/entry\/Functionapply<\/a> <\/p>\n<p><a href=\"http:\/\/www.java-samples.com\/showtutorial.php?tutorialid=829\">http:\/\/www.java-samples.com\/showtutorial.php?tutorialid=829<\/a> <\/p>\n<p>\uc704\uc640 \uac19\uc740 \uc598\uae30\uac00 \uc788\uc73c\ub2c8, \uc9c1\uc811 \ucc3e\uc544\ubcf4\uace0;;;;<br \/>\n\ub0b4 \uacbd\uc6b0\uc5d0\ub294 \uc784\uc758\ub85c \uc0dd\uc131\ud55c Class instance\uc5d0\uc11c \uacf5\ud1b5\uc73c\ub85c \uac04\uacb0\ud558\uac8c ajax\ud638\ucd9c \uc218\ud589 \ud6c4 \ubc18\ud658\ub418\ub294 \uac12\uc5d0 \ub300\ud574\uc11c \ucc98\ub9ac\ud558\ub294 callback function\uc744 \uad6c\ud604\ud568\uc5d0 \uc788\uc5b4\uc11c&#8230;&#8230; callback function\uc744 Class \ub0b4\ubd80\uc5d0 \uad6c\ud604\ud558\uace0, ajax \ud638\ucd9c \ud6c4 \ud574\ub2f9 function\uc744 \uc2e4\ud589\ud558\uc5ec \ucc98\ub9ac\ud558\ub294\ub370 \uc0ac\uc6a9\ud568. <\/p>\n<p>TestClass = function() {<br \/>\nfn$ajax(url, data, this); <\/p>\n<p><span style=\"color: #0000ff;\">TestClass.prototype.ajaxCallback = function(data) {<\/span><br \/>\n<span style=\"color: #0000ff;\">\u00a0 \u00a0 \u00a0 \u00a0 \/\/ data[&#8216;\ubd88\ub77c\ubd88\ub77c&#8217;];<\/span><br \/>\n<span style=\"color: #0000ff;\">\u00a0<\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,6],"tags":[],"class_list":["post-22","post","type-post","status-publish","format-standard","hentry","category-development","category-javascript"],"_links":{"self":[{"href":"http:\/\/www.freesens.com\/x\/index.php?rest_route=\/wp\/v2\/posts\/22","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.freesens.com\/x\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.freesens.com\/x\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.freesens.com\/x\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.freesens.com\/x\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=22"}],"version-history":[{"count":4,"href":"http:\/\/www.freesens.com\/x\/index.php?rest_route=\/wp\/v2\/posts\/22\/revisions"}],"predecessor-version":[{"id":24,"href":"http:\/\/www.freesens.com\/x\/index.php?rest_route=\/wp\/v2\/posts\/22\/revisions\/24"}],"wp:attachment":[{"href":"http:\/\/www.freesens.com\/x\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=22"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.freesens.com\/x\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=22"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.freesens.com\/x\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=22"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}