
<?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; JavaScript</title>
	<atom:link href="http://www.blueiblog.com/ko/archives/category/%ed%94%84%eb%a1%9c%ea%b7%b8%eb%9e%98%eb%b0%8d/javascript/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>bit.ly Short URL API – jQuery로 Shorten 메소드 이용해보기</title>
		<link>http://www.blueiblog.com/ko/archives/2546</link>
		<comments>http://www.blueiblog.com/ko/archives/2546#comments</comments>
		<pubDate>Mon, 07 Jun 2010 02:55:35 +0000</pubDate>
		<dc:creator>Blueⓘ</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Open API]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[bit.ly]]></category>

		<guid isPermaLink="false">http://www.blueiblog.com/ko/archives/2546</guid>
		<description><![CDATA[PHP – bit.ly Short URL API API Key 획득 및 API 목록 Shorten 메소드 설명 PHP로 Shorten 메소드 이용해보기 jQuery로 Shorten 메소드 이용해보기 이번에는 jQuery를 이용 한 bit.ly API 코딩 실전으로 들어가겠습니다. 기본적으로 jQuery(JavaScript)를 이용한 외부 서버 접속은 보안상의 이슈로 처리 되지 않습니다만, JSON의 경우는 JavaScript로도 보안상의 문제 없이 외부 서버의 JSON을 처리 할 수 [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; margin: 0 0 10px 20px; background: #fff;">
<fieldset>
<legend>PHP – bit.ly Short URL API</legend>
<ol style="margin: 0; padding: 0 35px 0 20px;">
<li><a href="http://www.blueiblog.com/ko/archives/1976">API Key 획득 및 API 목록</a></li>
<li><a href="http://www.blueiblog.com/ko/archives/1986">Shorten 메소드 설명</a></li>
<li><a href="http://www.blueiblog.com/ko/archives/2029">PHP로 Shorten 메소드 이용해보기</a></li>
<li><a href="http://www.blueiblog.com/ko/archives/2546">jQuery로 Shorten 메소드 이용해보기</a></li>
</ol>
</fieldset>
</div>
<p>이번에는 jQuery를 이용 한 bit.ly API 코딩 실전으로 들어가겠습니다. </p>
<p>기본적으로 jQuery(JavaScript)를 이용한 외부 서버 접속은 보안상의 이슈로 처리 되지 않습니다만, JSON의 경우는 JavaScript로도 보안상의 문제 없이 외부 서버의 JSON을 처리 할 수 있습니다. bit.ly의 API는 JSON을 지원하기때문에 우리는 jQuery AJAX의 JSON을 이용하여 동적으로 Shorten URL을 서비스 할 수 있습니다.</p>
<h2>jQuery로 Shorten메소드 호출</h2>
<p>앞서 3장에서 다룬 내용대로 &#8220;http://www.blueiblog.com/ko/archives/1976&#8243;을 줄일때 우리는 &#8220;http://api.bit.ly/shorten?version=2.0.1&#038;longUrl=http://www.blueiblog.com/ko/archives/1976&#038;login=xxxx&#038;apiKey=xxxxxxxxxxxx&#8221;와 같이 Shorten URL을 요청했습니다. </p>
<p>그럼 3장과 같은 내용의 함수를 jQuery로 바꾸어보도록 하겠습니다.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">/**
 * License by Blueⓘ
 *
 * @param String longURL 짧게 변경할 긴 문자열의 URL
 * @return String 짧게 변환된 URL
 */</span>
<span style="color: #003366; font-weight: bold;">function</span> getShortURL<span style="color: #009900;">&#40;</span>longURL<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> ret<span style="color: #339933;">;</span>
	$.<span style="color: #660066;">getJSON</span><span style="color: #009900;">&#40;</span>
		<span style="color: #3366CC;">&quot;http://api.bit.ly/shorten?version=2.0.1&amp;longUrl=&quot;</span><span style="color: #339933;">+</span>longURL<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;&amp;login=xxxx&amp;apiKey=xxxxxxxxxxxx&quot;</span><span style="color: #339933;">,</span>
		<span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			ret <span style="color: #339933;">=</span> data.<span style="color: #660066;">results</span><span style="color: #009900;">&#91;</span>url<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">shortUrl</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">return</span> ret<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> 
&nbsp;
$<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>getShortURL<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;http://test.com&quot;</span><span style="color: #009900;">&#41;</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>
<span style="color: #006600; font-style: italic;">// OUTPUT : http://bit.ly/9ICmwA</span></pre></div></div>

<p>이렇게 바뀔 수 있겠네요.. 위 코드는 테스트 없이 그냥 즉석에서 소스를 jQuery용으로 변경 한 것입니다. 테스트 없이 코드를 올려서 죄송합니다 ㅠ.ㅠ 혹 문제가 없을거라고 믿으나 있다면 댓글로 노티 부탁드리겠습니다.</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=7389289" 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/2546/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>[JavaScript] 문자열을 숫자로 변환(Converting Strings to Numbers)</title>
		<link>http://www.blueiblog.com/ko/archives/2128</link>
		<comments>http://www.blueiblog.com/ko/archives/2128#comments</comments>
		<pubDate>Mon, 22 Mar 2010 02:40:53 +0000</pubDate>
		<dc:creator>Blueⓘ</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Convertor]]></category>
		<category><![CDATA[변환]]></category>
		<category><![CDATA[자바스크립트]]></category>

		<guid isPermaLink="false">http://www.blueiblog.com/ko/archives/2128</guid>
		<description><![CDATA[자바스크립트는 형 지정형 언어가 아니기에 스크립트가 자동으로 상황에 맞게 형을 지정해주게 됩니다. 이에 숫자를 저장한 변수지만 문자열로 인식 계산전에 형을 변환해주어야 할 필요성이 있습니다. 아래는 자바스크립트에서 Float 그리고 Int로 형으로 형 변환을 하는 예제 입니다. parseFloat syntax: parseFloat(&#8216;string&#8217;) parseFloat&#40;'1.45kg'&#41; // 1.45 parseFloat&#40;'77.3'&#41; // 77.3 parseFloat&#40;'077.3'&#41; // 77.3 parseFloat&#40;'0x77.3'&#41; // 0 parseFloat&#40;'.3'&#41; // 0.3 parseFloat&#40;'0.1e6'&#41; // [...]]]></description>
			<content:encoded><![CDATA[<p>자바스크립트는 형 지정형 언어가 아니기에 스크립트가 자동으로 상황에 맞게 형을 지정해주게 됩니다. 이에 숫자를 저장한 변수지만 문자열로 인식 계산전에 형을 변환해주어야 할 필요성이 있습니다.</p>
<p>아래는 자바스크립트에서 Float 그리고 Int로 형으로 형 변환을 하는 예제 입니다.</p>
<p><strong>parseFloat syntax<strong>:   parseFloat(&#8216;string&#8217;)</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">parseFloat<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'1.45kg'</span><span style="color: #009900;">&#41;</span>  <span style="color: #006600; font-style: italic;">// 1.45</span>
parseFloat<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'77.3'</span><span style="color: #009900;">&#41;</span>    <span style="color: #006600; font-style: italic;">// 77.3</span>
parseFloat<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'077.3'</span><span style="color: #009900;">&#41;</span>   <span style="color: #006600; font-style: italic;">// 77.3</span>
parseFloat<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'0x77.3'</span><span style="color: #009900;">&#41;</span>  <span style="color: #006600; font-style: italic;">// 0</span>
parseFloat<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.3'</span><span style="color: #009900;">&#41;</span>      <span style="color: #006600; font-style: italic;">// 0.3</span>
parseFloat<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'0.1e6'</span><span style="color: #009900;">&#41;</span>   <span style="color: #006600; font-style: italic;">// 100000</span></pre></div></div>

<p><strong>parseInt syntax</strong>:   parseInt( &#8216;string&#8217; [, base] )</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">parseInt<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'123.45'</span><span style="color: #009900;">&#41;</span>  <span style="color: #006600; font-style: italic;">// 123</span>
parseInt<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'77'</span><span style="color: #009900;">&#41;</span>      <span style="color: #006600; font-style: italic;">// 77</span>
parseInt<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'077'</span><span style="color: #339933;">,</span><span style="color: #CC0000;">10</span><span style="color: #009900;">&#41;</span>  <span style="color: #006600; font-style: italic;">// 77</span>
parseInt<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'77'</span><span style="color: #339933;">,</span><span style="color: #CC0000;">8</span><span style="color: #009900;">&#41;</span>    <span style="color: #006600; font-style: italic;">// 63  (= 7 + 7*8)</span>
parseInt<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'077'</span><span style="color: #009900;">&#41;</span>     <span style="color: #006600; font-style: italic;">// 63  (= 7 + 7*8)</span>
parseInt<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'77'</span><span style="color: #339933;">,</span><span style="color: #CC0000;">16</span><span style="color: #009900;">&#41;</span>   <span style="color: #006600; font-style: italic;">// 119 (= 7 + 7*16)</span>
parseInt<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'0x77'</span><span style="color: #009900;">&#41;</span>    <span style="color: #006600; font-style: italic;">// 119 (= 7 + 7*16)</span>
parseInt<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'099'</span><span style="color: #009900;">&#41;</span>     <span style="color: #006600; font-style: italic;">// 0 (9 is not an octal digit)</span>
parseInt<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'99'</span><span style="color: #339933;">,</span><span style="color: #CC0000;">8</span><span style="color: #009900;">&#41;</span>    <span style="color: #006600; font-style: italic;">// 0 or NaN, depending on the platform</span>
parseInt<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'0.1e6'</span><span style="color: #009900;">&#41;</span>   <span style="color: #006600; font-style: italic;">// 0</span>
parseInt<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ZZ'</span><span style="color: #339933;">,</span><span style="color: #CC0000;">36</span><span style="color: #009900;">&#41;</span>   <span style="color: #006600; font-style: italic;">// 1295 (= 35 + 35*36)</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.blueiblog.com/ko/archives/2128/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>클립보드 복사 스크립트</title>
		<link>http://www.blueiblog.com/ko/archives/1493</link>
		<comments>http://www.blueiblog.com/ko/archives/1493#comments</comments>
		<pubDate>Thu, 19 Nov 2009 02:58:14 +0000</pubDate>
		<dc:creator>Blueⓘ</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[clipboard]]></category>
		<category><![CDATA[클립보드]]></category>

		<guid isPermaLink="false">http://www.blueiblog.com/ko/archives/1493</guid>
		<description><![CDATA[예전에 썼던 포스팅중 분실되었던 클립보드 복사 스립트의 내용을 다시 올려봅니다. 트랙백 클릭시 자동으로 클립보드 복사해주는 스크립트 만들려다가 보니 Firefox에서는 제대로 작동을 하지 않아 만들어 봤습니다. Flash의 Clipboard를 이용하여 클립보드에 저장하는 방법입니다. IE+Firefox둘다 잘 작동됩니다. 오페라에서는 작동 않되는거 같군요.. swf파일은 다음 링크에서 다운로드 받으시면 됩니다. http://www.jeffothy.com/weblog/uploads/clipboard.php [copy_clipboard.js] 1 2 3 4 5 6 7 8 9 [...]]]></description>
			<content:encoded><![CDATA[<p>예전에 썼던 포스팅중 분실되었던 클립보드 복사 스립트의 내용을 다시 올려봅니다.</p>
<hr style="border: 1px solid #CBDEED;">
<p>트랙백 클릭시 자동으로 클립보드 복사해주는 스크립트 만들려다가 보니 Firefox에서는 제대로 작동을 하지 않아 만들어 봤습니다.</p>
<p>Flash의 Clipboard를 이용하여 클립보드에 저장하는 방법입니다. IE+Firefox둘다 잘 작동됩니다. 오페라에서는 작동 않되는거 같군요..</p>
<p>swf파일은 다음 링크에서 다운로드 받으시면 됩니다.<br />
<a href="http://www.jeffothy.com/weblog/uploads/clipboard.php" target="_blank">http://www.jeffothy.com/weblog/uploads/clipboard.php</a></p>
<p>[copy_clipboard.js]</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> copyClipboard<span style="color: #009900;">&#40;</span>inElement<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>inElement.<span style="color: #660066;">createTextRange</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #003366; font-weight: bold;">var</span> range <span style="color: #339933;">=</span> inElement.<span style="color: #660066;">createTextRange</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>range <span style="color: #339933;">&amp;&amp;</span> BodyLoaded<span style="color: #339933;">==</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span>
            range.<span style="color: #660066;">execCommand</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Copy'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000066; font-weight: bold;">else</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #003366; font-weight: bold;">var</span> flashcopier <span style="color: #339933;">=</span> <span style="color: #3366CC;">'flashcopier'</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span>flashcopier<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
            <span style="color: #003366; font-weight: bold;">var</span> divholder <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            divholder.<span style="color: #660066;">id</span> <span style="color: #339933;">=</span> flashcopier<span style="color: #339933;">;</span>
            document.<span style="color: #660066;">body</span>.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>divholder<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>                                                                                                                                   
        <span style="color: #009900;">&#125;</span>
        document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span>flashcopier<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> divinfo <span style="color: #339933;">=</span> <span style="color: #3366CC;">'&lt;embed src=&quot;_clipboard.swf&quot; FlashVars=&quot;clipboard='</span><span style="color: #339933;">+</span>encodeURIComponent<span style="color: #009900;">&#40;</span>inElement.<span style="color: #660066;">innerHTML</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #3366CC;">'&quot; width=&quot;0&quot; height=&quot;0&quot; type=&quot;application/x-shockwave-flash&quot;&gt;&lt;/embed&gt;'</span><span style="color: #339933;">;</span>
        document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span>flashcopier<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> divinfo<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'클립보드에 복사되었습니다.'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>[example.html]</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td 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>Flash를 이용한 클립보드 복사 예제<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: #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;">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;">'copy_clipboard.js'</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;">span</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;myurl&quot;</span> <span style="color: #000066;">onclick</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;copyClipboard(document.getElementById('myurl'));&quot;</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;cursor: pointer;&quot;</span>&gt;</span>http://www.blueiblog.com<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span> - URL을 클릭하시면 클립보드에 복사됩니다.
<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></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.blueiblog.com/ko/archives/1493/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SELECT BOX에서 데이터 좌우 이동</title>
		<link>http://www.blueiblog.com/ko/archives/1484</link>
		<comments>http://www.blueiblog.com/ko/archives/1484#comments</comments>
		<pubDate>Thu, 19 Nov 2009 01:57:44 +0000</pubDate>
		<dc:creator>Blueⓘ</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[SELECT BOX 컨트롤]]></category>

		<guid isPermaLink="false">http://www.blueiblog.com/ko/archives/1484</guid>
		<description><![CDATA[옛날에 작성했던 코드가 유실되어 다시 찾아서 올려 봅니다. 다빈님의 블로그에서 코드를 발견했네요. http://blog.naver.com/davincigo?Redirect=Log&#038;logNo=60090722631 다빈님 덕분에 자료를 다시 올릴수 있게되어 감사드립니다. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 [...]]]></description>
			<content:encoded><![CDATA[<p>옛날에 작성했던 코드가 유실되어 다시 찾아서 올려 봅니다.<br />
다빈님의 블로그에서 코드를 발견했네요.</p>
<p><a href="http://blog.naver.com/davincigo?Redirect=Log&#038;logNo=60090722631" target="_blank">http://blog.naver.com/davincigo?Redirect=Log&#038;logNo=60090722631</a></p>
<p>다빈님 덕분에 자료를 다시 올릴수 있게되어 감사드립니다.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">&lt;!--</span>
<span style="color: #808080; font-style: italic;">작 성 자 : Blueⓘ (bluei98@gmail.com)</span>
<span style="color: #808080; font-style: italic;">홈페이지 : http://www.blueiblog.com</span>
<span style="color: #808080; font-style: italic;">작 성 일 : 2005-02-15</span>
<span style="color: #808080; font-style: italic;">--&gt;</span>
<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;">language</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;javascript&quot;</span>&gt;</span>
	<span style="color: #808080; font-style: italic;">&lt;!--</span>
<span style="color: #808080; font-style: italic;">	function move(fbox, tbox) {</span>
<span style="color: #808080; font-style: italic;">		for(i=0; i&lt;fbox.options.length; i++)</span>
<span style="color: #808080; font-style: italic;">		{</span>
<span style="color: #808080; font-style: italic;">			if(fbox.options[i].selected)</span>
<span style="color: #808080; font-style: italic;">			{</span>
<span style="color: #808080; font-style: italic;">				tbox.options[tbox.options.length] = new Option(fbox.options[i].text, fbox.options[i].value);</span>
<span style="color: #808080; font-style: italic;">				fbox.options[i] = null;</span>
<span style="color: #808080; font-style: italic;">				i=i-1;</span>
<span style="color: #808080; font-style: italic;">			}</span>
<span style="color: #808080; font-style: italic;">		}</span>
<span style="color: #808080; font-style: italic;">	}</span>
&nbsp;
<span style="color: #808080; font-style: italic;">	function selectAll(box) {</span>
<span style="color: #808080; font-style: italic;">		for(var i=0; i&lt;box.length; i++) {</span>
<span style="color: #808080; font-style: italic;">			box.options[i].selected = true;</span>
<span style="color: #808080; font-style: italic;">		}</span>
<span style="color: #808080; font-style: italic;">	}</span>
<span style="color: #808080; font-style: italic;">	--&gt;</span>
	<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;">form</span> <span style="color: #000066;">method</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;post&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;FORM&quot;</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">table</span> <span style="color: #000066;">width</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;600&quot;</span> <span style="color: #000066;">align</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;center&quot;</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">tr</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">td</span> <span style="color: #000066;">width</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;280&quot;</span>&gt;</span>
				<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">select</span> <span style="color: #000066;">multiple</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;left[]&quot;</span> <span style="color: #000066;">size</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;15&quot;</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;width:100%;&quot;</span>&gt;</span>
				<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">option</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;111&quot;</span>&gt;</span>111<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">option</span>&gt;</span>
				<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">option</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;222&quot;</span>&gt;</span>222<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">option</span>&gt;</span>
				<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">option</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;333&quot;</span>&gt;</span>333<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">option</span>&gt;</span>
				<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">option</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;444&quot;</span>&gt;</span>444<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">option</span>&gt;</span>
				<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">option</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;555&quot;</span>&gt;</span>555<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">option</span>&gt;</span>
				<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">option</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;666&quot;</span>&gt;</span>666<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">option</span>&gt;</span>
				<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">select</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">td</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">td</span> <span style="color: #000066;">width</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;40&quot;</span>&gt;</span>
				<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;javascript:move(document.FORM.elements['left[]'],document.FORM.elements['right[]'])&quot;</span>&gt;</span>▶<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
				<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;javascript:move(document.FORM.elements['right[]'],document.FORM.elements['left[]'])&quot;</span>&gt;</span>◀<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">td</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">td</span> <span style="color: #000066;">width</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;280&quot;</span>&gt;</span>
				<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">select</span> <span style="color: #000066;">multiple</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;right[]&quot;</span> <span style="color: #000066;">size</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;15&quot;</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;width:100%;&quot;</span>&gt;</span>
				<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">option</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;777&quot;</span>&gt;</span>777<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">option</span>&gt;</span>
				<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">option</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;888&quot;</span>&gt;</span>888<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">option</span>&gt;</span>
				<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">select</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">td</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">tr</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">table</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">form</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.blueiblog.com/ko/archives/1484/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>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>
