<?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>IMOOH.COM &#187; เขียนโปรแกรม</title> <atom:link href="http://www.imooh.com/category/programming/feed" rel="self" type="application/rss+xml" /><link>http://www.imooh.com</link> <description>แบ่งปันเทคนิค ตัวอย่าง การใช้งาน PHP, JAVA, JavaScript, jQuery, MySQL, Oracle, Linux, ข่าวสารหรือสาระน่ารู้ต่างๆ ผ่านโลกออนไลน์</description> <lastBuildDate>Tue, 27 Dec 2011 17:34:49 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>การติดตั้ง Google App Engine Plugin &#8211; Eclipse 3.7 (Indigo)</title><link>http://www.imooh.com/%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%95%e0%b8%b4%e0%b8%94%e0%b8%95%e0%b8%b1%e0%b9%89%e0%b8%87-google-app-engine-plugin-eclipse-3-7-indigo</link> <comments>http://www.imooh.com/%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%95%e0%b8%b4%e0%b8%94%e0%b8%95%e0%b8%b1%e0%b9%89%e0%b8%87-google-app-engine-plugin-eclipse-3-7-indigo#comments</comments> <pubDate>Tue, 27 Dec 2011 17:34:34 +0000</pubDate> <dc:creator>imooh</dc:creator> <category><![CDATA[เขียนโปรแกรม]]></category> <category><![CDATA[เทคโนโลยี]]></category> <category><![CDATA[eclipse plugin]]></category> <category><![CDATA[google app engine]]></category> <category><![CDATA[java]]></category> <guid
isPermaLink="false">http://www.imooh.com/?p=983</guid> <description><![CDATA[<a
href="http://www.imooh.com/%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%95%e0%b8%b4%e0%b8%94%e0%b8%95%e0%b8%b1%e0%b9%89%e0%b8%87-google-app-engine-plugin-eclipse-3-7-indigo" title="การติดตั้ง Google App Engine Plugin - Eclipse 3.7 (Indigo)"><img
width="136" height="107" src="http://www.imooh.com/wp-content/uploads/2011/12/eclipse.png" class="attachment-extra-featured-image wp-post-image" alt="Eclipse - The Eclipse Foundation open source community website" title="eclipse" /></a>ขั้นตอนง่ายๆ ในการติดตั้ง Google App Engine Plugin ใน Eclipse (Indigo) เพื่อพัฒนา Java App Engine Application โดยการใช้ Software update ของ Eclipse เอง 1. ไปที่เมนู Help และเลือก Install New Software 2. ที่ช่อง Work With: ให้กรอกลิงค์ของ Google App Engine Plugin ครับ 3. จากนั้นก็เลือก Google &#8230;<p
class="read-more"><a
href="http://www.imooh.com/%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%95%e0%b8%b4%e0%b8%94%e0%b8%95%e0%b8%b1%e0%b9%89%e0%b8%87-google-app-engine-plugin-eclipse-3-7-indigo">Read more &#187;</a></p>]]></description> <wfw:commentRss>http://www.imooh.com/%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%95%e0%b8%b4%e0%b8%94%e0%b8%95%e0%b8%b1%e0%b9%89%e0%b8%87-google-app-engine-plugin-eclipse-3-7-indigo/feed</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>jQuery: การดึงเอาค่าของ attribute ของแท็ก html ด้วยฟังก์ชัน .attr()</title><link>http://www.imooh.com/jquery-get-value-of-attribute</link> <comments>http://www.imooh.com/jquery-get-value-of-attribute#comments</comments> <pubDate>Thu, 08 Sep 2011 10:06:27 +0000</pubDate> <dc:creator>imooh</dc:creator> <category><![CDATA[เขียนโปรแกรม]]></category> <category><![CDATA[attribute value]]></category> <category><![CDATA[function]]></category> <category><![CDATA[jquery]]></category> <guid
isPermaLink="false">http://www.imooh.com/?p=932</guid> <description><![CDATA[<a
href="http://www.imooh.com/jquery-get-value-of-attribute" title="jQuery: การดึงเอาค่าของ attribute ของแท็ก html ด้วยฟังก์ชัน .attr()"></a>อีกหนึ่งฟังก์ชันที่ผมใช้อยู่บ่อยๆ ของ jQuery ก็คือ ฟังก์ชัน attr() ซึ่งฟังก์ชันนี้จะใช้สำหรับการดึงค่า(get) ของ attribute และกำหนดค่า(set) ของ attribute โดยรูปแบบการใช้งานก็ง่ายๆ ครับ คือ การดึงค่า attribute ก็จะประมาณนี้ครับ .attr(ชื่อของ attribute ที่ต้องการค่า) เช่น ถ้าเราต้องการดึงเอาค่าของ alt ของแท็ก img jQuery ก็จะเขียนได้แบบนี้ครับ การกำหนดค่า attribute ล่ะ จะทำไง ก็ง่ายๆ เลยครับ .attr(ชื่อของ attribute ที่ต้องการค่า, ค่าของ attribute) เช่น เราต้องการกำหนดค่า &#8230;<p
class="read-more"><a
href="http://www.imooh.com/jquery-get-value-of-attribute">Read more &#187;</a></p>]]></description> <wfw:commentRss>http://www.imooh.com/jquery-get-value-of-attribute/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>jQuery: Calendars Datepicker ป๊อปอัพปฏิทินสำหรับเลือกวันที่ภาษาไทย</title><link>http://www.imooh.com/jquery-thai-calendars-datepicker-plugin</link> <comments>http://www.imooh.com/jquery-thai-calendars-datepicker-plugin#comments</comments> <pubDate>Tue, 06 Sep 2011 06:50:21 +0000</pubDate> <dc:creator>imooh</dc:creator> <category><![CDATA[เขียนโปรแกรม]]></category> <category><![CDATA[calendar picker]]></category> <category><![CDATA[datepicker]]></category> <category><![CDATA[jquery]]></category> <category><![CDATA[thai calendar]]></category> <category><![CDATA[ปฏิทินภาษาไทย]]></category> <category><![CDATA[พ.ศ.]]></category> <guid
isPermaLink="false">http://www.imooh.com/?p=926</guid> <description><![CDATA[<a
href="http://www.imooh.com/jquery-thai-calendars-datepicker-plugin" title="jQuery: Calendars Datepicker ป๊อปอัพปฏิทินสำหรับเลือกวันที่ภาษาไทย"><img
width="211" height="200" src="http://www.imooh.com/wp-content/uploads/2011/09/thai-calendars-datepicker.png" class="attachment-extra-featured-image wp-post-image" alt="ป๊อปอัพปฏิทินภาษาไทย" title="ป๊อปอัพปฏิทินภาษาไทย" /></a>jQuery Calendars Datepicker เป็นตัวเสริม (plugin) ของ jQuery ที่สามารถแสดงผลปฏิทินเป็นภาษาไทย (ปี พ.ศ. ด้วยนะครับ) และก็รองรับอีกหลายภาษาเลยล่ะครับ (ประมาณ 60 กว่าภาษาครับ) ซึ่งดูแล้วน่าจะเป็นประโยชน์สำหรับเพื่อนๆ ที่กำลังมองหา plugin แนวๆ นี้อยู่นะครับ หรือคนที่ยังใช้ dropdown อยู่ก็ลองเปลี่ยนมาใช้แบบนี้ดูนะครับ จะทำให้เว็บน่าใช้ขึ้นอีกเยอะครับ ^^ มาดูวิธีการใช้งานบ้างครับ ว่าต้องทำไงบ้าง อันดับแรกเลยก็ไปดาวน์โหลดมาก่อนเลยครับ พอดาวน์โหลดเสร็จแล้ว แตกไฟล์ออกมาเราจะมีไฟล์เยอะแยะเลยครับ แต่ที่เราจะใช้จริงมีอยู่ประมาณ 7 ไฟล์ด้วยกันคือ จะเป็น javascript 6 ไฟล์และ stylesheet อีก 1 &#8230;<p
class="read-more"><a
href="http://www.imooh.com/jquery-thai-calendars-datepicker-plugin">Read more &#187;</a></p>]]></description> <wfw:commentRss>http://www.imooh.com/jquery-thai-calendars-datepicker-plugin/feed</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>กำหนดรูปภาพเริ่มต้น(default image) ให้กับเว็บไซต์ด้วย htaccess</title><link>http://www.imooh.com/set-default-image-for-website-with-htaccess</link> <comments>http://www.imooh.com/set-default-image-for-website-with-htaccess#comments</comments> <pubDate>Fri, 05 Aug 2011 10:13:26 +0000</pubDate> <dc:creator>imooh</dc:creator> <category><![CDATA[เขียนโปรแกรม]]></category> <category><![CDATA[เทคโนโลยี]]></category> <category><![CDATA[404]]></category> <category><![CDATA[htaccess]]></category> <category><![CDATA[image]]></category> <category><![CDATA[mod_rewrite]]></category> <guid
isPermaLink="false">http://www.imooh.com/?p=920</guid> <description><![CDATA[<a
href="http://www.imooh.com/set-default-image-for-website-with-htaccess" title="กำหนดรูปภาพเริ่มต้น(default image) ให้กับเว็บไซต์ด้วย htaccess"></a>เห็นหัวข้อแล้วอาจจะงงนิดๆ บทความนี้จะช่วยเพื่อนๆ แก้ปัญหาเกี่ยวกับการอ้างไปยังรูปที่ไม่มีอยู่จริง หรือถูกลบไปแล้วบนเว็บ ซึ่งปกติหากเราอ้างไปหาเซิฟเวอร์ก็จะรีเทิร์นสถานะกลับมาเป็น 404 ทำให้ตำแหน่งที่เราใส่รูปพวกนั้นเข้าไปจะแสดงเป็นกากบาท ทำให้ผู้ที่เข้ามาชมเว็บของเรารู้สึกว่าเว็บมันมีปัญหา อาจจะส่งผลให้ผู้ใช้หนีไปเลยก็เป็นได้ ซึ่งปัญหาดังกล่าวสามารถที่จะแก้ไขได้ด้วยการแสดงรูปภาพที่เป็นข้อความว่าไม่มีรูป (no image) แทนที่จะปล่อยให้เป็นรูปกากบาท โดยตรงนี้เราสามารถเขียน htaccess เอารูปที่เราต้องการมาแสดงได้เลยครับ ถ้าเกิดอ้างถึงรูปที่มีนามสกุล gif png หรือ jpg แล้ว ไม่มีรูปอยู่บนเซิฟเวอร์ เซิฟเวอร์ก็จะเอารูป no-image.gif แสดงแทนครับ]]></description> <wfw:commentRss>http://www.imooh.com/set-default-image-for-website-with-htaccess/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>jQuery : วิธีการใช้ jquery ติ๊กเลือก checkbox หลายๆ ค่า</title><link>http://www.imooh.com/jquery-multi-checkbox-select</link> <comments>http://www.imooh.com/jquery-multi-checkbox-select#comments</comments> <pubDate>Wed, 27 Jul 2011 07:06:00 +0000</pubDate> <dc:creator>imooh</dc:creator> <category><![CDATA[เขียนโปรแกรม]]></category> <category><![CDATA[checkbox]]></category> <category><![CDATA[jquery]]></category> <category><![CDATA[multi]]></category> <guid
isPermaLink="false">http://www.imooh.com/?p=918</guid> <description><![CDATA[<a
href="http://www.imooh.com/jquery-multi-checkbox-select" title="jQuery : วิธีการใช้ jquery ติ๊กเลือก checkbox หลายๆ ค่า"></a>ถ้าหากตอนนี้เพื่อนๆ กำลังหาวิธีที่จะใช้ jQuery ในการเลือก input ที่เป็น checkbox หลายๆ ค่า มาถูกที่แล้วครับ ฮ่าๆ ๆ ซึ่ง jQuery จะมีฟังก์ชัน val() ที่ใช้สำหรับกำหนดค่าของ input ต่างๆ อยู่แล้วครับ โดยฟังก์ชันนี้จะรับค่าเป็นค่าเดี่ยวๆ หรือจะเป็น array ก็ได้ครับ เช่น ถ้าเราต้องการดึงเอาค่าของ checkbox ที่ถูกเลือกอยู่ เรา แล้วถ้าเราต้องการให้ jQuery ติ๊ก checkbox ให้เราล่ะจะทำไง ก็ประมาณนี้เลยครับ โค้ด HTML โค้ด Javascript]]></description> <wfw:commentRss>http://www.imooh.com/jquery-multi-checkbox-select/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>การเซต timeout ในฟังก์ชัน file_get_contents ของ PHP</title><link>http://www.imooh.com/php-timeout-setting-file-get-contents</link> <comments>http://www.imooh.com/php-timeout-setting-file-get-contents#comments</comments> <pubDate>Sun, 10 Jul 2011 17:24:26 +0000</pubDate> <dc:creator>imooh</dc:creator> <category><![CDATA[เขียนโปรแกรม]]></category> <category><![CDATA[file_get_contents]]></category> <category><![CDATA[php]]></category> <category><![CDATA[timeout]]></category> <guid
isPermaLink="false">http://www.imooh.com/?p=909</guid> <description><![CDATA[<a
href="http://www.imooh.com/php-timeout-setting-file-get-contents" title="การเซต timeout ในฟังก์ชัน file_get_contents ของ PHP"></a>วันนี้เอาวิธีการเซตค่า timeout ให้กับฟังก์ชัน file_get_contents ของ PHP มาฝาก ซึ่งปกติผมก็ไม่ได้มีการเซตค่า timeout สำหรับฟังก์ชันนี้เลย ซึ่งอาจจะทำให้ response time ของเว็บเราเยอะได้ จะส่งผลต่อ robot ของ search engine เอา โดยการเซตค่า timeout ให้ฟังก์ชัน file_get_contents เป็นการบอกให้ฟังก์ชันไม่ต้องรอต่อไป หาก url ที่เราดึงเนื้อหาไม่ยอม response ค่ากลับมาภายในเวลาที่เรากำหนด ฟังก์ชัน file_get_contents ยังมีลูกเล่นอีกเยอะครับ เดี๋ยวถ้ามีเวลาจะเอามาฝากอีกครับ ^^]]></description> <wfw:commentRss>http://www.imooh.com/php-timeout-setting-file-get-contents/feed</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>มาเปลี่ยน syntax color ของ Eclipse กันดีกว่า</title><link>http://www.imooh.com/custom-eclipse-syntax-color</link> <comments>http://www.imooh.com/custom-eclipse-syntax-color#comments</comments> <pubDate>Tue, 28 Jun 2011 05:50:45 +0000</pubDate> <dc:creator>imooh</dc:creator> <category><![CDATA[เขียนโปรแกรม]]></category> <category><![CDATA[eclipse]]></category> <category><![CDATA[plugin]]></category> <category><![CDATA[theme color]]></category> <guid
isPermaLink="false">http://www.imooh.com/?p=901</guid> <description><![CDATA[<a
href="http://www.imooh.com/custom-eclipse-syntax-color" title="มาเปลี่ยน syntax color ของ Eclipse กันดีกว่า"></a>เพื่อนๆ ที่กำลังใช้ Eclipse อยู่ ถ้าเกิดไม่อยากรูปแบบของสี (default) ที่ใช้อยู่ แล้วเกิดอยากเปลี่ยนสีของโค้ด (syntax color) หรือธีม (Theme) ผมขอแนะนำ eclipse plugin อีกตัวที่จะช่วยให้เพื่อนๆ สามารถเปลี่ยนธีมได้ นั่นก็คือ Eclipse Color Themes วิธีติดตั้ง ก็เข้าไปที่ Help &#62; Install New Software&#8230; จากนั้นก็ก๊อปปี้ URL ข้างล่างไปวางที่ช่อง Work with จากนั้นก็กด Next แล้วก็ Finish หลังจาก Restart ก็เข้าไปที่ Window &#8230;<p
class="read-more"><a
href="http://www.imooh.com/custom-eclipse-syntax-color">Read more &#187;</a></p>]]></description> <wfw:commentRss>http://www.imooh.com/custom-eclipse-syntax-color/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>วิธีการใช้งาน Captcha Helper ของ Codeigniter</title><link>http://www.imooh.com/%e0%b8%a7%e0%b8%b4%e0%b8%98%e0%b8%b5%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b9%83%e0%b8%8a%e0%b9%89%e0%b8%87%e0%b8%b2%e0%b8%99-captcha-helper-%e0%b8%82%e0%b8%ad%e0%b8%87-codeigniter</link> <comments>http://www.imooh.com/%e0%b8%a7%e0%b8%b4%e0%b8%98%e0%b8%b5%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b9%83%e0%b8%8a%e0%b9%89%e0%b8%87%e0%b8%b2%e0%b8%99-captcha-helper-%e0%b8%82%e0%b8%ad%e0%b8%87-codeigniter#comments</comments> <pubDate>Mon, 16 May 2011 10:00:00 +0000</pubDate> <dc:creator>imooh</dc:creator> <category><![CDATA[เขียนโปรแกรม]]></category> <category><![CDATA[captcha]]></category> <category><![CDATA[codeigniter]]></category> <category><![CDATA[example]]></category> <category><![CDATA[helper]]></category> <guid
isPermaLink="false">http://www.imooh.com/?p=887</guid> <description><![CDATA[<a
href="http://www.imooh.com/%e0%b8%a7%e0%b8%b4%e0%b8%98%e0%b8%b5%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b9%83%e0%b8%8a%e0%b9%89%e0%b8%87%e0%b8%b2%e0%b8%99-captcha-helper-%e0%b8%82%e0%b8%ad%e0%b8%87-codeigniter" title="วิธีการใช้งาน Captcha Helper ของ Codeigniter"></a>การป้องกันการสแปมที่ได้รับความนิยมในปัจจุบันเห็นทีจะต้องยกให้ CAPTCHA (Completely Automated Public Turing test to tell Computers and Humans Apart) ซึ่งจะเป็นการให้ผู้ใช้ (user) กรอกรหัสที่แสดงเป็นรูปภาพ เช่น ทำความรู้จักกันแล้วก็มาเข้าเรื่องกันเลยดีกว่าครับ บทความนี้จะพูดถึงวิธีการใช้งาน Captcha Helper ของ CI (Codeigniter) ซึ่งขั้นตอนการใช้งานก็มีดังนี้ครับ 1. สร้างเทเบิล (Table) ชื่อ captcha โดยมีโครงสร้างดังนี้ครับ 2. สร้างโฟลเดอร์ captcha สร้างไว้ที่ Document root และกำหนด permission เป็น 666 หรือ 777 3. ตัวอย่างการใช้งาน จากนั้นที่หน้าที่เรา &#8230;<p
class="read-more"><a
href="http://www.imooh.com/%e0%b8%a7%e0%b8%b4%e0%b8%98%e0%b8%b5%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b9%83%e0%b8%8a%e0%b9%89%e0%b8%87%e0%b8%b2%e0%b8%99-captcha-helper-%e0%b8%82%e0%b8%ad%e0%b8%87-codeigniter">Read more &#187;</a></p>]]></description> <wfw:commentRss>http://www.imooh.com/%e0%b8%a7%e0%b8%b4%e0%b8%98%e0%b8%b5%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b9%83%e0%b8%8a%e0%b9%89%e0%b8%87%e0%b8%b2%e0%b8%99-captcha-helper-%e0%b8%82%e0%b8%ad%e0%b8%87-codeigniter/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>วิธีการ redirect โดเมนที่ไม่มี www ไปหา www ด้วยไฟล์ htaccess</title><link>http://www.imooh.com/redirect-all-non-www-requests-to-www</link> <comments>http://www.imooh.com/redirect-all-non-www-requests-to-www#comments</comments> <pubDate>Thu, 12 May 2011 04:16:13 +0000</pubDate> <dc:creator>imooh</dc:creator> <category><![CDATA[เขียนโปรแกรม]]></category> <category><![CDATA[htaccess]]></category> <category><![CDATA[non-www]]></category> <category><![CDATA[redirect]]></category> <category><![CDATA[www]]></category> <guid
isPermaLink="false">http://www.imooh.com/?p=884</guid> <description><![CDATA[<a
href="http://www.imooh.com/redirect-all-non-www-requests-to-www" title="วิธีการ redirect โดเมนที่ไม่มี www ไปหา www ด้วยไฟล์ htaccess"></a>เพื่อนๆ ที่มีเว็บหรือบล็อกเป็นของตัวเองลองเข้าเว็บตัวเองโดยไม่ต้องใส่ www ข้างหน้าดูว่าเข้าได้รึป่าว เช่น http://domain.com ถ้าเข้าได้แล้วลองเปลี่ยนเป็นแบบมี www ด้วย เช่น http://www.domain.com ถ้าเข้าได้อีกและมีเนื้อหาเหมือนกันแล้ว เพื่อนๆ อาจจะถูก search engine มองว่าเป็น duplicate content ครับ เพื่อแก้ไขปัญหานี้เราก็จัดการ redirect จากที่ไม่มี www ไปหาที่มี www ซะเลย โดยการใช้ไฟล์ htaccess เข้าช่วย โดยเพิ่มโค้ดนี้เข้าไปในไฟล์ครับ บรรทัดแรกเป็นการตรวจสอบว่าลิงค์มี www อยู่ข้างหน้ารึป่าว เช่น imooh.com บรรทัดที่สอง ถ้าตรวจสอบว่าไม่มี www ให้ &#8230;<p
class="read-more"><a
href="http://www.imooh.com/redirect-all-non-www-requests-to-www">Read more &#187;</a></p>]]></description> <wfw:commentRss>http://www.imooh.com/redirect-all-non-www-requests-to-www/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>jQuery: มาทำความรู้จักกับ jQuery.data() กัน</title><link>http://www.imooh.com/%e0%b8%a1%e0%b8%b2%e0%b8%97%e0%b8%b3%e0%b8%84%e0%b8%a7%e0%b8%b2%e0%b8%a1%e0%b8%a3%e0%b8%b9%e0%b9%89%e0%b8%88%e0%b8%b1%e0%b8%81%e0%b8%81%e0%b8%b1%e0%b8%9a-jquery-data-%e0%b8%81%e0%b8%b1%e0%b8%99</link> <comments>http://www.imooh.com/%e0%b8%a1%e0%b8%b2%e0%b8%97%e0%b8%b3%e0%b8%84%e0%b8%a7%e0%b8%b2%e0%b8%a1%e0%b8%a3%e0%b8%b9%e0%b9%89%e0%b8%88%e0%b8%b1%e0%b8%81%e0%b8%81%e0%b8%b1%e0%b8%9a-jquery-data-%e0%b8%81%e0%b8%b1%e0%b8%99#comments</comments> <pubDate>Tue, 10 May 2011 03:02:44 +0000</pubDate> <dc:creator>imooh</dc:creator> <category><![CDATA[เขียนโปรแกรม]]></category> <category><![CDATA[data]]></category> <category><![CDATA[jquery]]></category> <category><![CDATA[utility]]></category> <guid
isPermaLink="false">http://www.imooh.com/?p=875</guid> <description><![CDATA[<a
href="http://www.imooh.com/%e0%b8%a1%e0%b8%b2%e0%b8%97%e0%b8%b3%e0%b8%84%e0%b8%a7%e0%b8%b2%e0%b8%a1%e0%b8%a3%e0%b8%b9%e0%b9%89%e0%b8%88%e0%b8%b1%e0%b8%81%e0%b8%81%e0%b8%b1%e0%b8%9a-jquery-data-%e0%b8%81%e0%b8%b1%e0%b8%99" title="jQuery: มาทำความรู้จักกับ jQuery.data() กัน"></a>jQuery.data() เป็นอีกหนึ่งฟังก์ชันของ jQuery ที่เพื่อนๆ ควรจะนำมาใช้ครับ ประโยชน์ของฟังก์ชัน data() ก็คือ เพื่อนๆ สามารถเก็บข้อมูลที่เกี่ยวข้องกับ DOM element (หรืออาจจะไม่เกี่ยวข้องก็ได้นะครับ ^^) โดยการตั้งชื่อของข้อมูลนั้น แล้วก็บันทึกข้อมูลด้วยฟังก์ชัน jQuery.data() ครับ อ่านดูแล้วอาจจะงงๆ ลองมาดูตัวอย่างการใช้งานกันดีกว่าครับ 1. การเก็บข้อมูล รูปแบบการใช้งาน jQuery.data(element, key, value) element คือ DOM element ที่เกี่ยวข้องกับข้อมูล key คือ ชื่อของข้อมูลที่เราจะเก็บ value คือ ค่าหรือข้อมูลที่เราต้องการจะเก็บ 2. การดึงข้อมูล รูปแบบการใช้งาน jQuery.data(element, &#8230;<p
class="read-more"><a
href="http://www.imooh.com/%e0%b8%a1%e0%b8%b2%e0%b8%97%e0%b8%b3%e0%b8%84%e0%b8%a7%e0%b8%b2%e0%b8%a1%e0%b8%a3%e0%b8%b9%e0%b9%89%e0%b8%88%e0%b8%b1%e0%b8%81%e0%b8%81%e0%b8%b1%e0%b8%9a-jquery-data-%e0%b8%81%e0%b8%b1%e0%b8%99">Read more &#187;</a></p>]]></description> <wfw:commentRss>http://www.imooh.com/%e0%b8%a1%e0%b8%b2%e0%b8%97%e0%b8%b3%e0%b8%84%e0%b8%a7%e0%b8%b2%e0%b8%a1%e0%b8%a3%e0%b8%b9%e0%b9%89%e0%b8%88%e0%b8%b1%e0%b8%81%e0%b8%81%e0%b8%b1%e0%b8%9a-jquery-data-%e0%b8%81%e0%b8%b1%e0%b8%99/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
