
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>BlueⓘBlog &#187; jQuery</title>
	<atom:link href="http://www.blueiblog.com/ko/archives/tag/jquery/feed" rel="self" type="application/rss+xml" />
	<link>http://www.blueiblog.com/ko</link>
	<description>Blueⓘ의 인터넷 아지트</description>
	<lastBuildDate>Mon, 19 Jul 2010 05:42:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>jQuery 1.4 공식 릴리즈 소식</title>
		<link>http://www.blueiblog.com/ko/archives/1968</link>
		<comments>http://www.blueiblog.com/ko/archives/1968#comments</comments>
		<pubDate>Thu, 04 Feb 2010 05:52:11 +0000</pubDate>
		<dc:creator>Blueⓘ</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.blueiblog.com/ko/archives/1968</guid>
		<description><![CDATA[jQuery 1.4가 공식 릴리즈 되었습니다. 2010년 1월 14일이니 좀 됐군요&#8230; 1.4버젼이 공식 릴리즈 되면서 jQuery API 페이지의 변화가 보이는군요&#8230;(jQuery 1.4가 릴리즈 되었는데 홈페이지의 변화 부터 봅니다 ㅡㅡ;) 그동안 좀 보기 어려웠다고 할만한 API페이지가 조금 더 보기 쉽게 변화 되었습니다. 워낙 다른 API에 비해 메뉴얼이 어려워서 진입장벽이 있다고 생각하는 jQuery이기때문에 API 페이지에 신경쓴건 좋았다고 평하고 싶습니다. [...]]]></description>
			<content:encoded><![CDATA[<p>jQuery 1.4가 공식 릴리즈 되었습니다. 2010년 1월 14일이니 좀 됐군요&#8230;</p>
<p>1.4버젼이 공식 릴리즈 되면서 jQuery API 페이지의 변화가 보이는군요&#8230;(jQuery 1.4가 릴리즈 되었는데 홈페이지의 변화 부터 봅니다 ㅡㅡ;) 그동안 좀 보기 어려웠다고 할만한 API페이지가 조금 더 보기 쉽게 변화 되었습니다. 워낙 다른 API에 비해 메뉴얼이 어려워서 진입장벽이 있다고 생각하는 jQuery이기때문에 API 페이지에 신경쓴건 좋았다고 평하고 싶습니다.</p>
<h2>jQuery 1.4 Release Note</h2>
<p>우선 jQuery 1.4에서 변화된 내용을 살펴보면&#8230;</p>
<ol>
<li>좀 더 쉬운 setter 함수</li>
<li>.css()와 .attr()의 성능 향상</li>
<li>빠른 element 생성</li>
<li>기타 등등</li>
</ol>
<p>입니다&#8230; 뭐 워낙 많아서&#8230; 번역하기 힘듭니다 ^^ <a href="http://jquery14.com/day-01/jquery-14" target="_blank">http://jquery14.com/day-01/jquery-14</a> 에 접속하시면 직접 보실 수 있습니다. 게을러서 죄송합니다 ㅠ.ㅠ</p>
<p>뭐 <strong>전체적으로 성능이 무척 향상 되었고 괜찮은 기능좀 넣었다</strong> 라고 보시면 될거 같습니다.</p>
<div style="margin: 10px 0 10px 0; border: 3px solid #6FA7D1; display: inline-block; width: 720px;">
<p style="padding: 0 0 0 20px; margin: 0; line-height: 30px; border-bottom: 1px solid #6FA7D1; background: #CBDEED; font-weight: bold;">이 글이 도움이 않되셨더라도 왼쪽 아래에 있는 손 모양의 추천을 눌러주세요...^^</p>
<ul style="list-style-type: none; margin: 0;; padding: 0;">
<li style="width: 100px; float: left; padding-left: 30px; padding-top: 5px; margin: 5px 0;">
<embed src="http://api.v.daum.net/static/recombox3.swf?nid=5708130" quality="high" bgcolor="#ffffff" width="67" height="80" type="application/x-shockwave-flash"></embed>
</li><li style="height: 100px; overflow: hidden; padding: 20px 0 0 0; text-align: center; margin-bottom: -20px;">
<script type='text/javascript'><!--
google_ad_client = 'pub-1866412074966530';
/* 468x60, 작성됨 09. 10. 29 */
google_ad_slot = '9943142053';
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type='text/javascript'
src='http://pagead2.googlesyndication.com/pagead/show_ads.js'>
</script>
</li>
</ul></textarea>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.blueiblog.com/ko/archives/1968/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[jQuery Plug-in] 이미지 크롭 플러그인 &#8211; jCrop</title>
		<link>http://www.blueiblog.com/ko/archives/1397</link>
		<comments>http://www.blueiblog.com/ko/archives/1397#comments</comments>
		<pubDate>Mon, 16 Nov 2009 06:39:06 +0000</pubDate>
		<dc:creator>Blueⓘ</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[crop]]></category>
		<category><![CDATA[jCrop]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[이미지크롭]]></category>

		<guid isPermaLink="false">http://www.blueiblog.com/ko/archives/1397</guid>
		<description><![CDATA[오늘 소개해드릴 플러그인은 jCrop이라는 이미지 크롭 플러그인입니다. jCrop은 사용자가 올린 이미지 또는 기타 등등의 이유로 사용자 직접 크롭핑 할 부분을 선택하여 크롭핑을 할 수 있도록 도와주는 jQuery 플러그인입니다. 아래는 jCrop의 Live Demo입니다. &#60;html&#62; &#60;head&#62; &#60;script src=&#34;js/jquery.Jcrop.js&#34;&#62;&#60;/script&#62; &#60;link rel=&#34;stylesheet&#34; href=&#34;css/jquery.Jcrop.css&#34; type=&#34;text/css&#34; /&#62; &#60;script&#62; jQuery(document).ready(function(){ jQuery('#cropbox').Jcrop({ aspectRatio: 1, onSelect: updateCoords, setSelect: [ 100, 100, 200, 200 ] [...]]]></description>
			<content:encoded><![CDATA[<p>오늘 소개해드릴 플러그인은 jCrop이라는 이미지 크롭 플러그인입니다.</p>
<p>jCrop은 사용자가 올린 이미지 또는 기타 등등의 이유로 사용자 직접 크롭핑 할 부분을 선택하여 크롭핑을 할 수 있도록 도와주는 jQuery 플러그인입니다.</p>
<p>아래는 jCrop의 Live Demo입니다.</p>
<p><center><img src="/include/postExamples/jCrop/demos/demo_files/flowers.jpg" id="cropbox" /></center></p>
<p><br/></p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;js/jquery.Jcrop.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;css/jquery.Jcrop.css&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
		jQuery(document).ready(function(){
			jQuery('#cropbox').Jcrop({
				aspectRatio: 1,
				onSelect: updateCoords,
				setSelect: [ 100, 100, 200, 200 ]
			});
&nbsp;
		});
	<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">center</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/include/postExamples/jCrop/demos/demo_files/flowers.jpg&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;cropbox&quot;</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">center</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></pre></div></div>

<p>다운로드 : <img src="http://www.blueiblog.com/ko/wp-includes/images/crystal/archive.png" width="20" align="absmiddle" /> <a href='http://www.blueiblog.com/ko/wp-content/uploads/2009/11/jquery.Jcrop-0.9.81.zip'>jquery.Jcrop-0.9.8.zip</a></p>
<link rel="stylesheet" href="/include/postExamples/jCrop/css/jquery.Jcrop.css" type="text/css" />
<script src="/include/postExamples/jCrop/js/jquery.Jcrop.js"></script><br />
<script src="/include/postExamples/jCrop/demo.js"></script></p>
<div style="margin: 10px 0 10px 0; border: 3px solid #6FA7D1; display: inline-block; width: 720px;">
<p style="padding: 0 0 0 20px; margin: 0; line-height: 30px; border-bottom: 1px solid #6FA7D1; background: #CBDEED; font-weight: bold;">이 글이 도움이 않되셨더라도 왼쪽 아래에 있는 손 모양의 추천을 눌러주세요...^^</p>
<ul style="list-style-type: none; margin: 0;; padding: 0;">
<li style="width: 100px; float: left; padding-left: 30px; padding-top: 5px; margin: 5px 0;">
<embed src="http://api.v.daum.net/static/recombox3.swf?nid=4794931" quality="high" bgcolor="#ffffff" width="67" height="80" type="application/x-shockwave-flash"></embed>
</li><li style="height: 100px; overflow: hidden; padding: 20px 0 0 0; text-align: center; margin-bottom: -20px;">
<script type='text/javascript'><!--
google_ad_client = 'pub-1866412074966530';
/* 468x60, 작성됨 09. 10. 29 */
google_ad_slot = '9943142053';
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type='text/javascript'
src='http://pagead2.googlesyndication.com/pagead/show_ads.js'>
</script>
</li>
</ul></textarea>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.blueiblog.com/ko/archives/1397/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[예제] 이미지 크롭(Crop) 스크립트</title>
		<link>http://www.blueiblog.com/ko/archives/1309</link>
		<comments>http://www.blueiblog.com/ko/archives/1309#comments</comments>
		<pubDate>Thu, 05 Nov 2009 05:59:14 +0000</pubDate>
		<dc:creator>Blueⓘ</dc:creator>
				<category><![CDATA[주절주절]]></category>
		<category><![CDATA[crop]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[plug-in]]></category>

		<guid isPermaLink="false">http://www.blueiblog.com/ko/archives/1309</guid>
		<description><![CDATA[다음은 이미지 Crop을 해주는 스크립트를 제공해주는 사이트를 소개하려고 합니다. jQuery의 플러그인형태로 개발되었으며 크롭후 서버사이드에서 php를 통해 썸네일을 생성하는 부분까지 제공해주는군요. 사이트 주소는 http://deepliquid.com/content/Jcrop.html 입니다. 다운로드는 하단의 링크를 통해 다운로드 받으실수 있습니다. Jcrop-0.9.8.zip Jcrop-0.9.8.tar.gz 아래의 PHP소스는 서버사이드에서 이미지중 크롭핑된 부분을 썸네일화 하는 부분입니다. 1 2 3 4 5 6 7 8 9 10 11 $targ_w = [...]]]></description>
			<content:encoded><![CDATA[<p>다음은 이미지 Crop을 해주는 스크립트를 제공해주는 사이트를 소개하려고 합니다.<br />
jQuery의 플러그인형태로 개발되었으며 크롭후 서버사이드에서 php를 통해 썸네일을 생성하는 부분까지 제공해주는군요.</p>
<p>사이트 주소는 <a href="http://deepliquid.com/content/Jcrop.html" target="_blank">http://deepliquid.com/content/Jcrop.html</a> 입니다.</p>
<p>다운로드는 하단의 링크를 통해 다운로드 받으실수 있습니다.</p>
<ul>
<li><a href='http://www.blueiblog.com/ko/wp-content/uploads/2009/11/jquery.Jcrop-0.9.8.zip'>Jcrop-0.9.8.zip</a></li>
<li><a href='http://www.blueiblog.com/ko/wp-content/uploads/2009/11/jquery.Jcrop-0.9.8.tar.gz'>Jcrop-0.9.8.tar.gz</a></li>
</ul>
<p>아래의 PHP소스는 서버사이드에서 이미지중 크롭핑된 부분을 썸네일화 하는 부분입니다.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$targ_w</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$targ_h</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">150</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$jpeg_quality</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">90</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$src</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'demo_files/flowers.jpg'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$img_r</span> <span style="color: #339933;">=</span> <span style="color: #990000;">imagecreatefromjpeg</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$src</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$dst_r</span> <span style="color: #339933;">=</span> <span style="color: #990000;">ImageCreateTrueColor</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$targ_w</span><span style="color: #339933;">,</span> <span style="color: #000088;">$targ_h</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">imagecopyresampled</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dst_r</span><span style="color: #339933;">,</span><span style="color: #000088;">$img_r</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'x'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'y'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$targ_w</span><span style="color: #339933;">,</span><span style="color: #000088;">$targ_h</span><span style="color: #339933;">,</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'w'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'h'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Content-type: image/jpeg'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">imagejpeg</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dst_r</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">,</span> <span style="color: #000088;">$jpeg_quality</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>아래는 이해를 돕기위한 이미지 ^^</p>
<p><a href="http://www.blueiblog.com/ko/wp-content/uploads/2009/11/2009-11-05_144735.gif"><img src="http://www.blueiblog.com/ko/wp-content/uploads/2009/11/2009-11-05_144735-720x549.gif" alt="jCrop" title="jCrop" width="720" height="549" class="aligncenter size-large wp-image-1311" /></a></p>
<div style="margin: 10px 0 10px 0; border: 3px solid #6FA7D1; display: inline-block; width: 720px;">
<p style="padding: 0 0 0 20px; margin: 0; line-height: 30px; border-bottom: 1px solid #6FA7D1; background: #CBDEED; font-weight: bold;">이 글이 도움이 않되셨더라도 왼쪽 아래에 있는 손 모양의 추천을 눌러주세요...^^</p>
<ul style="list-style-type: none; margin: 0;; padding: 0;">
<li style="width: 100px; float: left; padding-left: 30px; padding-top: 5px; margin: 5px 0;">
<embed src="http://api.v.daum.net/static/recombox3.swf?nid=4677256" quality="high" bgcolor="#ffffff" width="67" height="80" type="application/x-shockwave-flash"></embed>
</li><li style="height: 100px; overflow: hidden; padding: 20px 0 0 0; text-align: center; margin-bottom: -20px;">
<script type='text/javascript'><!--
google_ad_client = 'pub-1866412074966530';
/* 468x60, 작성됨 09. 10. 29 */
google_ad_slot = '9943142053';
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type='text/javascript'
src='http://pagead2.googlesyndication.com/pagead/show_ads.js'>
</script>
</li>
</ul></textarea>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.blueiblog.com/ko/archives/1309/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Core &#8211; jQuery(=$) &#8211; 작성중</title>
		<link>http://www.blueiblog.com/ko/archives/780</link>
		<comments>http://www.blueiblog.com/ko/archives/780#comments</comments>
		<pubDate>Wed, 15 Jul 2009 02:22:11 +0000</pubDate>
		<dc:creator>Blueⓘ</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jQuery Core]]></category>

		<guid isPermaLink="false">http://www.blueiblog.com/ko/archives/780</guid>
		<description><![CDATA[jQuery의 기본중 기본인 jQuery Core의 jQuery메소드에 대한 강좌를 진행하겠습니다. jQuery(=$)메소드는 jQuery Core의 핵심 메소드로 jQuery 또는 $로 사용 할 수 있습니다. 다음은 그 예제 입니다. jQuery&#40;'#textBox'&#41;; $&#40;'#textBox'&#41;; 위 예제는 textBox라는 ID를 가진 HTML객체를 jQuery를 이용하여 찾는 예제입니다. 앞에 설명한대로 jQuery와 $가 동일하다고 하였기에 각각의 명령은 동일한 결과를 가집니다. jQuery(=$) 문법 jQuery(expression [, context]) jQuery(html, [ownerDocument]) [...]]]></description>
			<content:encoded><![CDATA[<p>jQuery의 기본중 기본인 jQuery Core의 jQuery메소드에 대한 강좌를 진행하겠습니다.</p>
<p>jQuery(=$)메소드는 jQuery Core의 핵심 메소드로 jQuery 또는 $로 사용 할 수 있습니다. 다음은 그 예제 입니다.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#textBox'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#textBox'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>위 예제는 textBox라는 ID를 가진 HTML객체를 jQuery를 이용하여 찾는 예제입니다. 앞에 설명한대로 jQuery와 $가 동일하다고 하였기에 각각의 명령은 동일한 결과를 가집니다.</p>
<div class="lecture_title">jQuery(=$)</div>
<ul>
<li><strong>문법</strong>
<ul>
<li>jQuery(expression [, context])</li>
<li>jQuery(html, [ownerDocument])</li>
<li>jQuery(elements)</li>
<li>jQuery(callback)</li>
</ul>
</li>
</ul>
<div class="lecture_title">Blueⓘ의 요약 설명</div>
<p>jQuery메소드는 4개가 오버라이드 되어 있습니다&#8230; 처음에는 똑같은 메소드가 4개 존재하여 습득하는데 어려움이 있을것이라 생각하고 계실지 모르겠지만, 간단하게 요약하면 <strong>jQuery메소드는 HTML안에서 내가 원하는 Element를 최대한 쉽고 빠르게 컨트롤 하기 위해 존재하는 메소드</strong>입니다. 즉 4개의 오버라이드된 메소드 역시 그런 역활을 담당하기 위해서 존재하므로 Element 컨트롤용이라고 생각하시면 두려움이 좀 사라질까요? ^^</p>
<p>각각의 jQuery 메소드의 사용 문법을 한글로 표기하자면 다음과 같습니다.</p>
<p>1. jQuery(&#8220;검색하고자하는 selector 표현식&#8221; [, "검색 대상 구문"])<br />
2. jQuery(&#8220;Document에 추가할 HTML형식의 문자열&#8221; [, "추가 대상 Document"])<br />
3. jQuery(&#8220;검색하고자 하는 Element&#8221;)<br />
4. jQuery(&#8220;콜백 메소드&#8221;)</p>
<p>자 그럼 위의 4개의 메소드를 예제를 통해 익혀보도록 하겠습니다.</p>
<p>위 4개의 메소드를 익히는동안 우리를 도와줄 HTML군을 소개해드리겠습니다.</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">title</span>&gt;</span>jQuery Core - jQuery(=$)<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">title</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/js/common/jquery-1.3.2.min.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h3</span>&gt;</span>Examples for jQuery<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h3</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;myDiv&quot;</span>&gt;</span>Hello, jQuery
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;ulOfDiv&quot;</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>What is jQuery Core<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;myP&quot;</span>&gt;</span>Hello, jQuery
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;ulOfP&quot;</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>What is jQuery Core<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Thanks, Blueⓘ<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></pre></div></div>

<div class="lecture_title">jQuery(expression [, context])</div>
<p>jQuery(expression [, context])는 jQuery를 이용하여 여러분이 원하는 객체를 찾도록 도와주는 메소드입니다. 인자로는 expression이 있고 context는 옵션인자로 입력하지 않아도 무방합니다.</p>
<p>그럼 각 인자를 살펴보도록 하죠.</p>
<p>expression은 단어뜻을 보면 표현입니다. 즉 jQuery를 이용하여 원하는 객체를 찾도록 표현하라는것입니다. jQuery의 객체 탐색은 이 표현을 통해 이루어집니다. 보통 HTML태그를 통해서 찾기를 원한다면 jQuery(&#8216;input&#8217;)과 같이 &#8220;input태그를 찾아라&#8221;라고 명령할수 있으며 ID값으로 찾기를 원한다면 jQuery(&#8216;#아이디&#8217;)와 같이 찾을수 있습니다. 또한 class값으로 찾기를 원한다면 jQuery(&#8216;.클래스&#8217;)로 찾을수 있습니다.</p>
<p>자 그럼 <strong>jQuery를 통해 첫번째 div태그를 찾아보도록 하겠습니다.</strong> 어떤 방법이 있을까요?</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#myDiv'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>위의 예제에서 보듯이 두가지 방법으로 찾을 수 있겠죠? 첫번째는 태그를 통해서&#8230; 두번째는 태그안에 설정된 ID값을 통해서 찾아 보았습니다. 위 예제에서는 태그를 찾은다음 그 안에 있는 HTML값을 alert을 이용하여 출력하도록 한 예제입니다.</p>
<blockquote><p>
<strong>Blueⓘ의 사족</strong></p>
<p>여기서 기존 JavaScript와 차이가 보입니다. 그럼 그 차이를 한번 보겠습니다.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">getElementByID</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'myDiv'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">innerHTML</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#myDiv'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>위 예제는 jQuery를 사용하지 않고 DIV태그의 ID를 통해 객체를 찾은다음 그 객체 안에 존재하는 HTML을 출력하는 예제이며 아래는 jQuery를 이용해서 객체 안에 존재하는 HTML을 출력하는 예제입니다. 소스가 짧고 간편하게 처리 할 수 있어 좋긴 하지만 html()이라는 메소드는 도대체 무엇일까요? 옆에 있는 정아무개씨는 <strong>&#8220;내가 자바스크립트를 10년째 하지만 본적도 없는 메소드다&#8221;</strong>라고 합니다. </p>
<p>맞습니다. html()이라는 메소드는 jQuery의 메소드이지 기존 JavaScript의 메소드가 아닙니다. Prototype이라는 또다른 JavaScript프레임워크와 jQuery와 가장 큰 차이점중 하나가 이것입니다. Prototype은 객체를 찾은다음 순수한 JavaScript의 객체값을 넘겨주지만 <strong>jQuery는 탐색한 객체를 jQuery객체로 만들어서 리턴</strong>을 해줍니다.</p>
<p>그럼 좀더 알기 쉽게 하기위해 각각 어떤 객체를 넘겨주는지 알아보도록 하겠습니다. 아래 그림은 alert(jQuery(&#8216;#myDiv&#8217;));와 alert(document.getElementById(&#8216;myDiv&#8217;));로 각각 어떤 값이 리턴되어 넘어오는지 확인해본 결과 입니다.</p>
<p><a href="http://www.blueiblog.com/ko/wp-content/uploads/2009/07/jquery-element.gif"><img src="http://www.blueiblog.com/ko/wp-content/uploads/2009/07/jquery-element-510x185.gif" alt="jquery-element" title="jquery-element" width="510" height="185" class="aligncenter size-large wp-image-867" /></a></p>
<p>jQuery를 통한 결과는 일반 Object를 getElementById를 통한 결과는 DivElement를 리턴 해주었습니다. 결국 jQuery를 이용한여 탐색은 객체는 기존 JavaScript의 상식으로는 처리 할 수 없다는 단점을 가지고 있습니다. 하지만 이런 단점들을 웃어넘길수 있을정도로 jQuery의 세계는 막강합니다.</p></blockquote>
<p>그럼 두번째 <strong>P태그는 어떤 방식으로 찾을 수 있을까요?</strong> 벌써 응용력이 생기셨을거라 생각합니다. 답은 아래와 같습니다.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'p'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#myP'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.blueiblog.com/ko/archives/780/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>jQuery와 Prototype 같이 사용하는 방법</title>
		<link>http://www.blueiblog.com/ko/archives/759</link>
		<comments>http://www.blueiblog.com/ko/archives/759#comments</comments>
		<pubDate>Tue, 14 Jul 2009 03:14:53 +0000</pubDate>
		<dc:creator>Blueⓘ</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jQuery 입문강좌]]></category>

		<guid isPermaLink="false">http://www.blueiblog.com/ko/archives/759</guid>
		<description><![CDATA[JQuery와 Prototype을 같이 써야 하는 경우가 발생 할 수 있습니다. Jquery와 Prototype모두 장단점이 있기때문이기도 한데 이렇게 두 API를 모두 사용 할 경우 $메소드가 중복되어 Javascript에러가 발생합니다. 이경우에는 prototype과 jquery를 인클루드 한다음 jQuery.noConflict();명령을 하단에 추가해주시면 됩니다. jQuery.noConflict()는 jQuery에서 $메소드 사용을 하지 않겠다는 의미입니다. 그렇다면 &#8220;jQuery는 어떻게 사용하죠??&#8221; 하고 물으신다면 jQuery메소드를 사용하면 된다고 말씀드리겠습니다. 원래 jQuery에서 $(=jQuery)이므로 [...]]]></description>
			<content:encoded><![CDATA[<p>JQuery와 Prototype을 같이 써야 하는 경우가 발생 할 수 있습니다. Jquery와 Prototype모두 장단점이 있기때문이기도 한데 이렇게 두 API를 모두 사용 할 경우 $메소드가 중복되어 Javascript에러가 발생합니다. </p>
<p>이경우에는 prototype과 jquery를 인클루드 한다음 <strong>jQuery.noConflict();</strong>명령을 하단에 추가해주시면 됩니다.</p>
<p>jQuery.noConflict()는 jQuery에서 $메소드 사용을 하지 않겠다는 의미입니다.</p>
<p>그렇다면 &#8220;jQuery는 어떻게 사용하죠??&#8221; 하고 물으신다면 jQuery메소드를 사용하면 된다고 말씀드리겠습니다. 원래 jQuery에서 $(=jQuery)이므로 $를 사용하지 않는다면 jQuery사용시에는 jQuery메소드를 사용하시면 됩니다. 아래는 noConflict의 예제입니다.</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'text/javascript'</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/js/prototype.js?ver=1.6&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/js/jquery-1.3.2.min.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span>
		jQuery.noConflict();
	<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #808080; font-style: italic;">&lt;!-- TODO --&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></pre></div></div>

<p>다음은 jQuery의 $메소드 사용과 jQuery.noConflict를 사용하여 jQuery에서 $메소드를 사용 할 수 없을경우를 비교한것입니다.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// $메소드를 사용 할 수 있는 경우</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#btn'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ok'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// $메소드를 사용 할 수 없는 경우(jQuery와 Prototype을 동시에 쓸 경우)</span>
jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#btn'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ok'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>즉 $만 jQuery로 변경하시면 됩니다.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.blueiblog.com/ko/archives/759/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
