<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1246208863353533089</id><updated>2024-08-28T00:11:55.382-07:00</updated><category term="พื้นฐาน"/><category term="ajax"/><category term="json"/><category term="แก้ไข"/><title type='text'>JQuery</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://jquery-thaigroup.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246208863353533089/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://jquery-thaigroup.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Admin</name><uri>http://www.blogger.com/profile/06932457368166496936</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>9</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1246208863353533089.post-6815005859316215404</id><published>2011-10-14T22:04:00.001-07:00</published><updated>2011-10-14T22:04:29.926-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="พื้นฐาน"/><title type='text'>CDN คืออะไร</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #f0f0f0; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;center style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;size-full wp-image-1432 alignright&quot; height=&quot;110&quot; src=&quot;http://www.jquery.in.th/uploads//2011/05/logo-jquery.png&quot; style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;logo-jquery&quot; width=&quot;350&quot; /&gt;&lt;/center&gt;&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
วันนี้ออกนอกเรื่องสักหน่อยละกันครับ แต่ก็มีส่วนที่เกี่ยวข้อกับ jQuery อยู่บ้างเหมือนกัน เพราะเพื่อนๆที่พึ่งจะจับกับ jQuery ใหม่ๆอาจจะต้องศึกษาคำศัพท์เทคนิคต่างๆเพิ่ม เพราะไม่งั้นไปเจอเข้าอาจจะงงได้ครับ วันนี้เลยจะอธิบายเกี่ยวกับตัวย่อ CDN ว่ามันคืออะไร&lt;/div&gt;
&lt;div style=&quot;float: none; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: center;&quot;&gt;
&lt;ins style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; display: inline-table; height: 60px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: relative; visibility: visible; width: 468px;&quot;&gt;&lt;ins id=&quot;aswift_1_anchor&quot; style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; display: block; height: 60px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: relative; visibility: visible; width: 468px;&quot;&gt;&lt;iframe allowtransparency=&quot;true&quot; frameborder=&quot;0&quot; height=&quot;60&quot; hspace=&quot;0&quot; id=&quot;aswift_1&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; name=&quot;aswift_1&quot; scrolling=&quot;no&quot; style=&quot;left: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: absolute; top: 0px;&quot; vspace=&quot;0&quot; width=&quot;468&quot;&gt;&lt;/iframe&gt;&lt;/ins&gt;&lt;/ins&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
คำว่า CDN นั้นย่อมาจาก Content Delivery Network ครับ หรือ Content distribution network (CDN) ถ้าเกี่ยวกับ jQuery มันก็คือ Server ที่ทำการเก็บ source code ของตัว jQuery เอาไว้ให้เราเรียกใช้งานครับ&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
แล้วมันมีประโยชน์ยังไง? ประโยชน์ของมันเลยคือสามารถที่จะลดโหลด หรือ ภาระของเครื่อง Server ของเราเองได้ครับแทนที่เราจะเก็บ File jquery.js เอาไว้ที่ Server ของเราซึ่งหากเว็บเรานั้นมีทราฟฟิกจำนวนมากๆแล้ว แค่โหลด jquery.js 1 file ก็เพิ่มภาระให้กับ Server ของเราได้เช่นกัน ดังนั้นวิธีลดภาระก็คือใช้การโหลดจาก CDN Host ต่างๆที่ให้บริการครับ&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
CDN ต่างๆนี้จะทำการเก็บ copy source code ของ jQuery เวอร์ชั่นต่างๆเอาไว้ แทบจะเรียกได้ว่าเกือบทุกๆ version เลยก็ว่าได้นะครับ แถมบางเจ้านั้นจะมี Server ที่ให้บริการมากกว่า 10 เครื่องเลยทีเดียวทำให้การโหลด file jQuery นั้นทำได้รวดเร็ว&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
แต่วิธีนี้ไม่เหมาะกับการทำ Web Applcation แบบ offline หรือแบบ Intranet นะครับ เพราะว่าการใช้แบบ CDN นั้นจะต้อง online ครับถึงจะสามารถ load file jquery ได้&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
ตัวอย่างการ load file jQuery ผ่าน CDN ที่ต่างๆนะครับ เพื่อนๆสามารถเปลี่ยนเลขเวอร์ชั่นได้ตามที่ตัวเองใช้งานได้เลยครับ&lt;/div&gt;
&lt;div class=&quot;codecolorer-container javascript default&quot; style=&quot;background-color: #f1f1f1; border-bottom-color: rgb(159, 159, 159); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(159, 159, 159); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(159, 159, 159); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(159, 159, 159); border-top-style: solid; border-top-width: 1px; color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: auto; overflow-y: auto; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; white-space: nowrap; width: 580px;&quot;&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;tbody style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;tr style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;line-numbers&quot; style=&quot;background-color: #eeeeee; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-color: rgb(159, 159, 159); border-right-style: solid; border-right-width: 1px; border-style: initial; border-top-width: 0px; color: #888888; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; text-align: right;&quot;&gt;&lt;div style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 23px;&quot;&gt;
1&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;2&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;3&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;4&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;5&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;6&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;7&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;8&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;9&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;10&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;11&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;div class=&quot;javascript codecolorer&quot; style=&quot;background-color: #f1f1f1; color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; text-align: left;&quot;&gt;
&lt;span class=&quot;co1&quot; style=&quot;color: #406040; font-style: italic; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;// Google Ajax API CDN&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;script src&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js&quot;&lt;/span&gt;&amp;nbsp;type&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;lt;/&lt;/span&gt;script&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&lt;span class=&quot;co1&quot; style=&quot;color: #406040; font-style: italic; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;// Microsoft CDN&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;script src&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&quot;http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.min.js&quot;&lt;/span&gt;&amp;nbsp;type&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;lt;/&lt;/span&gt;script&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&lt;span class=&quot;co1&quot; style=&quot;color: #406040; font-style: italic; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;// jQuery CDN&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;script src&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&quot;http://code.jquery.com/jquery-1.6.min.js&quot;&lt;/span&gt;&amp;nbsp;type&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;lt;/&lt;/span&gt;script&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div style=&quot;float: none; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: center;&quot;&gt;
&lt;ins style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; display: inline-table; height: 60px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: relative; visibility: visible; width: 468px;&quot;&gt;&lt;ins id=&quot;aswift_2_anchor&quot; style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; display: block; height: 60px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: relative; visibility: visible; width: 468px;&quot;&gt;&lt;iframe allowtransparency=&quot;true&quot; frameborder=&quot;0&quot; height=&quot;60&quot; hspace=&quot;0&quot; id=&quot;aswift_2&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; name=&quot;aswift_2&quot; scrolling=&quot;no&quot; style=&quot;left: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: absolute; top: 0px;&quot; vspace=&quot;0&quot; width=&quot;468&quot;&gt;&lt;/iframe&gt;&lt;/ins&gt;&lt;/ins&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jquery-thaigroup.blogspot.com/feeds/6815005859316215404/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://jquery-thaigroup.blogspot.com/2011/10/cdn.html#comment-form' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246208863353533089/posts/default/6815005859316215404'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246208863353533089/posts/default/6815005859316215404'/><link rel='alternate' type='text/html' href='http://jquery-thaigroup.blogspot.com/2011/10/cdn.html' title='CDN คืออะไร'/><author><name>Admin</name><uri>http://www.blogger.com/profile/06932457368166496936</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246208863353533089.post-227239380421068940</id><published>2011-10-14T22:03:00.001-07:00</published><updated>2011-10-14T22:03:50.944-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="พื้นฐาน"/><title type='text'>วิธีใช้งาน jQuery หลายเวอร์ชั่นพร้อมๆกัน ด้วย noConflict</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #f0f0f0; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
ในบางครั้งเวลาที่เราพัฒนา Web application ที่ต้องพัฒนาจากของเก่าซึ่งอาจจะใช้ jQuery เวอร์ชั่นเก่าๆอยู่ก่อนแล้ว แต่ว่างานที่เราต้อง develop ใหม่จะต้องใช้ jQuery เวอร์ชั่นที่สูงกว่าและต้องไม่กระทบกับของเก่าที่มีอยู่แล้ว ปัญหานี้แก้ง่ายๆด้วยการใช้ jQuery หลายๆเวอร์ชั่นใน page เดียวกันไปเลย&lt;/div&gt;
&lt;div style=&quot;float: none; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: center;&quot;&gt;
&lt;ins style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; display: inline-table; height: 60px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: relative; visibility: visible; width: 468px;&quot;&gt;&lt;ins id=&quot;aswift_1_anchor&quot; style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; display: block; height: 60px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: relative; visibility: visible; width: 468px;&quot;&gt;&lt;iframe allowtransparency=&quot;true&quot; frameborder=&quot;0&quot; height=&quot;60&quot; hspace=&quot;0&quot; id=&quot;aswift_1&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; name=&quot;aswift_1&quot; scrolling=&quot;no&quot; style=&quot;left: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: absolute; top: 0px;&quot; vspace=&quot;0&quot; width=&quot;468&quot;&gt;&lt;/iframe&gt;&lt;/ins&gt;&lt;/ins&gt;&lt;/div&gt;
และจะทำยังไงละถึงจะใช้ jQuery หลายๆเวอร์ชั่นพร้อมๆกันไปได้ เราก็ใช้ function นี้ครับที่ jQuery ได้เตรียมแก้ปัญหานี้เอาไว้แล้ว&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
noConflict&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
มาดูตัวอย่าง code กันดีกว่า&lt;/div&gt;
&lt;div class=&quot;codecolorer-container javascript default&quot; style=&quot;background-color: #f1f1f1; border-bottom-color: rgb(159, 159, 159); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(159, 159, 159); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(159, 159, 159); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(159, 159, 159); border-top-style: solid; border-top-width: 1px; color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: auto; overflow-y: auto; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; white-space: nowrap; width: 580px;&quot;&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;tbody style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;tr style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;line-numbers&quot; style=&quot;background-color: #eeeeee; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-color: rgb(159, 159, 159); border-right-style: solid; border-right-width: 1px; border-style: initial; border-top-width: 0px; color: #888888; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; text-align: right;&quot;&gt;&lt;div style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 23px;&quot;&gt;
1&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;2&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;3&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;4&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;5&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;6&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;7&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;8&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;9&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;10&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;11&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;12&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;13&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;14&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;15&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;16&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;17&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;18&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;div class=&quot;javascript codecolorer&quot; style=&quot;background-color: #f1f1f1; color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; text-align: left;&quot;&gt;
&lt;span class=&quot;co1&quot; style=&quot;color: #406040; font-style: italic; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;// jQuery Version 1.5.2&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;script src&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&quot;jquery-1-5-2.js&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;script&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;script&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;kw2&quot; style=&quot;color: #2060a0; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;var&lt;/span&gt;&amp;nbsp;oldVersion&amp;nbsp;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;=&lt;/span&gt;&amp;nbsp;jQuery.&lt;span class=&quot;me1&quot; style=&quot;color: #0080ff; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;noConflict&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;lt;/&lt;/span&gt;script&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&lt;span class=&quot;co1&quot; style=&quot;color: #406040; font-style: italic; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;//jQuery new version 1.6&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;script src&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&quot;jquery-1-6.js&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;script&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;script&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;kw2&quot; style=&quot;color: #2060a0; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;var&lt;/span&gt;&amp;nbsp;newVersion&amp;nbsp;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;=&lt;/span&gt;&amp;nbsp;jQuery.&lt;span class=&quot;me1&quot; style=&quot;color: #0080ff; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;noConflict&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;lt;/&lt;/span&gt;script&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;div id&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&quot;testDiv&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;div&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;script&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;kw3&quot; style=&quot;color: teal; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;alert&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;(&lt;/span&gt;&amp;nbsp;oldVersion&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&#39;#testDiv&#39;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;)&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;kw3&quot; style=&quot;color: teal; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;alert&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;(&lt;/span&gt;&amp;nbsp;newVersion&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&#39;#testDiv&#39;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;)&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;lt;/&lt;/span&gt;script&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
เท่านี้ก็หมดปัญหาเรื่องการใช้งาน jQuery หลายๆเวอร์ชั้นแล้วครับ บางครั้งปัญหานี้ก็ไม่ได้เกิดจากการใช้งาน jQuery หลายๆเวอร์ชั่นนะครับ เพราะผมเองก็เคยเจอเวลาที่ใช้ javascript ค่ายอื่น แล้วพอเอา jQuery มาใช้ร่วมกันด้วยแล้วโปรแกรมไม่สามารถทำงานได้ ก็ได้วิธีนี้แหละครับในการแก้ไขปัญหานี้&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jquery-thaigroup.blogspot.com/feeds/227239380421068940/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://jquery-thaigroup.blogspot.com/2011/10/jquery-noconflict.html#comment-form' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246208863353533089/posts/default/227239380421068940'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246208863353533089/posts/default/227239380421068940'/><link rel='alternate' type='text/html' href='http://jquery-thaigroup.blogspot.com/2011/10/jquery-noconflict.html' title='วิธีใช้งาน jQuery หลายเวอร์ชั่นพร้อมๆกัน ด้วย noConflict'/><author><name>Admin</name><uri>http://www.blogger.com/profile/06932457368166496936</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246208863353533089.post-987493196728167445</id><published>2011-10-14T22:02:00.001-07:00</published><updated>2011-10-14T22:02:37.977-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="พื้นฐาน"/><title type='text'>ความแตกต่างของ .bind(), .live(), และ .delegate()</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #f0f0f0; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
สวัสดีจ้า ไม่ได้อัพเดทเป็นเวลานานอีกแล้วครับ แฮ่ะๆ วันนี้นำเสนอเรื่องราวของ .bind(), .live(), .delegeate() ดีกว่าครับ เพราะมีหลายคนที่งง และสงสัย ว่ามันต่างกันอย่างไร และเอาไปใช้งานในงานลักษณะใหน ใช้กันตอนใหน เอาเป็นว่าคลิกเข้ามาอ่านด้านในกันเลยดีกว่าครับ :)&lt;/div&gt;
&lt;div style=&quot;float: none; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: center;&quot;&gt;
&lt;ins style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; display: inline-table; height: 60px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: relative; visibility: visible; width: 468px;&quot;&gt;&lt;ins id=&quot;aswift_1_anchor&quot; style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; display: block; height: 60px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: relative; visibility: visible; width: 468px;&quot;&gt;&lt;iframe allowtransparency=&quot;true&quot; frameborder=&quot;0&quot; height=&quot;60&quot; hspace=&quot;0&quot; id=&quot;aswift_1&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; name=&quot;aswift_1&quot; scrolling=&quot;no&quot; style=&quot;left: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: absolute; top: 0px;&quot; vspace=&quot;0&quot; width=&quot;468&quot;&gt;&lt;/iframe&gt;&lt;/ins&gt;&lt;/ins&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;img alt=&quot;&quot; height=&quot;171&quot; src=&quot;http://www.jquery.in.th/uploads//2011/02/SCRUM-Board-with-comments.jpg&quot; style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; width=&quot;500&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
Image from :&amp;nbsp;&lt;a href=&quot;http://www.alfajango.com/&quot; style=&quot;color: #1fa2e1; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;&quot;&gt;http://www.alfajango.com&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
เริ่มกันเลยไม่ต้องยืดยาวกันมาก เน้นกระชับๆละกันนะครับ ช่วงนี้เวลาในการเขียน Blog ของผมค่อนข้างจะน้อยลงเดี๋ยวจะต้องจัดตารางเวลากันใหม่สักหน่อยครับ เอาละ เรามาว่ากันที่เจ้า method .bind(); กันก่อนเลย เพื่อนๆหลายคนสงสัยกันมากว่ามันเอาไว้ทำอะไร โดยเฉพาะ โปรแกรมเมอร์มือใหม่ เจ้าตัว method .bind นี้นะครับ เอาไว้จำหรับการ ผูก หรือ นำเอา Events เช่น Click, Mouse Over หรือที่เรียกกันว่า CSS Selector เอาไปกำหนดให้กับ Element ที่เราต้องการ เช่นกำหนดให้กำ Element &amp;lt;a&amp;gt; เป็นต้น&lt;/div&gt;
&lt;div class=&quot;codecolorer-container javascript default&quot; style=&quot;background-color: #f1f1f1; border-bottom-color: rgb(159, 159, 159); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(159, 159, 159); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(159, 159, 159); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(159, 159, 159); border-top-style: solid; border-top-width: 1px; color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: auto; overflow-y: auto; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; white-space: nowrap; width: 580px;&quot;&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;tbody style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;tr style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;line-numbers&quot; style=&quot;background-color: #eeeeee; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-color: rgb(159, 159, 159); border-right-style: solid; border-right-width: 1px; border-style: initial; border-top-width: 0px; color: #888888; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; text-align: right;&quot;&gt;&lt;div style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 23px;&quot;&gt;
1&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;div class=&quot;javascript codecolorer&quot; style=&quot;background-color: #f1f1f1; color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; text-align: left;&quot;&gt;
$&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&#39;a&#39;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;)&lt;/span&gt;.&lt;span class=&quot;me1&quot; style=&quot;color: #0080ff; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;bind&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&#39;click&#39;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;,&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;kw2&quot; style=&quot;color: #2060a0; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;(&lt;/span&gt;e&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;{&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;kw3&quot; style=&quot;color: teal; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;alert&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;(&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&#39;Clicked!!&#39;&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;;&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
จาก code ตัวอย่างด้านบน เป็นการ binding event Click ให้กับ Elements ทั้งหมด ที่อยู่ภายใต้ Docment Root นะครับ เพื่อนๆบางท่านอาจจะงงว่า Document root คืออะไร ดูตามตัวอย่างด้านล่างนี้ครับน่าจะ เข้าใจง่ายขึ้น&lt;/div&gt;
&lt;div class=&quot;codecolorer-container html4strict default&quot; style=&quot;background-color: #f1f1f1; border-bottom-color: rgb(159, 159, 159); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(159, 159, 159); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(159, 159, 159); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(159, 159, 159); border-top-style: solid; border-top-width: 1px; color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: auto; overflow-y: auto; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; white-space: nowrap; width: 580px;&quot;&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;tbody style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;tr style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;line-numbers&quot; style=&quot;background-color: #eeeeee; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-color: rgb(159, 159, 159); border-right-style: solid; border-right-width: 1px; border-style: initial; border-top-width: 0px; color: #888888; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; text-align: right;&quot;&gt;&lt;div style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 23px;&quot;&gt;
1&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;2&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;3&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;4&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;5&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;6&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;7&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;8&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;9&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;10&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;11&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;div class=&quot;html4strict codecolorer&quot; style=&quot;background-color: #f1f1f1; color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; text-align: left;&quot;&gt;
//This is DOM Tree&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;window&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp; &amp;nbsp;|_document&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; |_H1&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; |_H2&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; |_p&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |_span&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |_a&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; |_form&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |_input&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |_submit&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
จาก DOM Tree ด้านบนนี้จะเห็นว่า document นั้นเป็น Root บนสุดของทุกๆ Element หรือจะเรียกว่าเป็น Root node ก็ว่าได้ ดังนั้นเวลาที่เรา binding events เข้าไปที่ Elements A ตัว jQuery Object จะทำการ Scan หา TAG A หรือ Elements A แล้วทำการใสคำสั่ง click เข้าไป&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
จะเห็นว่าเจ้า method .build เนี่ย มันจะทำงานได้กับ Elements ที่มีอยู่ในขณะนั้นเท่านั้น ถ้าหากว่า มีการเพิ่ม Elements A เข้ามาภายหลัง เช่น เกิดจากการโหลดมาจาก AJAX เข้ามา พวก Element A ที่เข้ามาทีหลังนั้น จะไม่ถูก binding event click เข้าไป ซึ่งเพื่อนๆหลายท่านคงจะเคยเจอปัญหาแบบนี้นะครับ&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
เพื่อแก้ไขปัญหานี้จึงเกิด Methods ใหม่ขั้นมาอีกสองตัวคือ .live() และ .delegate()&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;.live() และ .deledate() นั้นจริงๆแล้วเหมือนกันครับ เพียงแต่ .delegate() จะทำงานได้เร็วกว่า .live() ส่วนที่ว่าทำไมถึงทำงานได้เร็วกว่านั้น เดี๋ยวผมขอเวลาไปหาคำตอบก่อนนะครับ แฮ่ะๆ ขอติดไว้ก่อน&lt;/div&gt;
&lt;div class=&quot;codecolorer-container javascript default&quot; style=&quot;background-color: #f1f1f1; border-bottom-color: rgb(159, 159, 159); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(159, 159, 159); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(159, 159, 159); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(159, 159, 159); border-top-style: solid; border-top-width: 1px; color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: auto; overflow-y: auto; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; white-space: nowrap; width: 580px;&quot;&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;tbody style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;tr style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;line-numbers&quot; style=&quot;background-color: #eeeeee; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-color: rgb(159, 159, 159); border-right-style: solid; border-right-width: 1px; border-style: initial; border-top-width: 0px; color: #888888; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; text-align: right;&quot;&gt;&lt;div style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 23px;&quot;&gt;
1&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;div class=&quot;javascript codecolorer&quot; style=&quot;background-color: #f1f1f1; color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; text-align: left;&quot;&gt;
$&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&#39;a&#39;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;)&lt;/span&gt;.&lt;span class=&quot;me1&quot; style=&quot;color: #0080ff; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;live&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;)&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;==&lt;/span&gt;&amp;nbsp;$&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;(&lt;/span&gt;document&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;)&lt;/span&gt;.&lt;span class=&quot;me1&quot; style=&quot;color: #0080ff; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;delegate&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&#39;a&#39;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;h2 style=&quot;font-size: 22px; font-style: italic; letter-spacing: -1px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 0px; padding-right: 0px; padding-top: 5px;&quot;&gt;
มาสรุปกันเลยว่า .bind(), .live or .delegate() นั้นใช้ต่างกันอย่างไร&lt;/h2&gt;
&lt;div class=&quot;codecolorer-container javascript default&quot; style=&quot;background-color: #f1f1f1; border-bottom-color: rgb(159, 159, 159); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(159, 159, 159); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(159, 159, 159); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(159, 159, 159); border-top-style: solid; border-top-width: 1px; color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: auto; overflow-y: auto; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; white-space: nowrap; width: 580px;&quot;&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;tbody style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;tr style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;line-numbers&quot; style=&quot;background-color: #eeeeee; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-color: rgb(159, 159, 159); border-right-style: solid; border-right-width: 1px; border-style: initial; border-top-width: 0px; color: #888888; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; text-align: right;&quot;&gt;&lt;div style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 23px;&quot;&gt;
1&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;2&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;3&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;4&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;5&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;div class=&quot;javascript codecolorer&quot; style=&quot;background-color: #f1f1f1; color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; text-align: left;&quot;&gt;
$&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&#39;a&#39;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;)&lt;/span&gt;.&lt;span class=&quot;me1&quot; style=&quot;color: #0080ff; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;bind&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;(&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&#39;click&#39;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;,&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&lt;span class=&quot;kw2&quot; style=&quot;color: #2060a0; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;(&lt;/span&gt;e&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;{&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&lt;span class=&quot;kw3&quot; style=&quot;color: teal; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;alert&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&#39;This is method bind.&#39;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
จาก code ด้านบนนี้ .bind นั้นจะสามารถใส่ event ให้กับ Element ที่มีอยู่ในขณะนั้นเท่านั้น ไม่สามารถกำหนด event ให้กับ element ที่เพิ่มเข้ามาทีหลังไม่ได้&lt;/div&gt;
&lt;div class=&quot;codecolorer-container javascript default&quot; style=&quot;background-color: #f1f1f1; border-bottom-color: rgb(159, 159, 159); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(159, 159, 159); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(159, 159, 159); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(159, 159, 159); border-top-style: solid; border-top-width: 1px; color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: auto; overflow-y: auto; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; white-space: nowrap; width: 580px;&quot;&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;tbody style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;tr style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;line-numbers&quot; style=&quot;background-color: #eeeeee; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-color: rgb(159, 159, 159); border-right-style: solid; border-right-width: 1px; border-style: initial; border-top-width: 0px; color: #888888; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; text-align: right;&quot;&gt;&lt;div style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 23px;&quot;&gt;
1&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;2&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;3&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;div class=&quot;javascript codecolorer&quot; style=&quot;background-color: #f1f1f1; color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; text-align: left;&quot;&gt;
$&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&#39;a&#39;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;)&lt;/span&gt;.&lt;span class=&quot;me1&quot; style=&quot;color: #0080ff; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;live&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&#39;click&#39;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;,&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;kw2&quot; style=&quot;color: #2060a0; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;)&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;{&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;kw3&quot; style=&quot;color: teal; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;alert&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&#39;This is live&#39;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;)&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&lt;span class=&quot;co1&quot; style=&quot;color: #406040; font-style: italic; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;// or&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;$&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;(&lt;/span&gt;document&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;)&lt;/span&gt;.&lt;span class=&quot;me1&quot; style=&quot;color: #0080ff; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;delegate&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&#39;a&#39;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;,&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&#39;click&#39;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;,&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;kw2&quot; style=&quot;color: #2060a0; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;)&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;{&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;kw3&quot; style=&quot;color: teal; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;alert&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&#39;This is Delegate); });&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
Code ด้านบนนี้สามารถกำหนด event ให้กับ Element A ได้ ถึงแม้ขณะนั้น ยังไม่มี Element A ใน document root ก็ตาม เช่น เมื่อมีการโหลด HTML เข้ามาผ่านทาง AJAX โดยที่มี Element A ติดเข้ามาด้วย Element A ที่เข้ามานั้นก็จะถูกจับ event click ใส่เข้าไปทันที&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
ผมคิดว่าบทความนี้ก็น่าจะพอแก้ไขปัญหา ข้อข้องใจของเพื่อนๆได้พอสมควรนะครับ ถ้าสงสัยตรงใหน ถามใน Facebook ได้เลยนะครับ http://www.facebook.com/jQuery.in.th&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jquery-thaigroup.blogspot.com/feeds/987493196728167445/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://jquery-thaigroup.blogspot.com/2011/10/bind-live-delegate.html#comment-form' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246208863353533089/posts/default/987493196728167445'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246208863353533089/posts/default/987493196728167445'/><link rel='alternate' type='text/html' href='http://jquery-thaigroup.blogspot.com/2011/10/bind-live-delegate.html' title='ความแตกต่างของ .bind(), .live(), และ .delegate()'/><author><name>Admin</name><uri>http://www.blogger.com/profile/06932457368166496936</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246208863353533089.post-6733831799796431062</id><published>2011-10-14T22:01:00.001-07:00</published><updated>2011-10-14T22:01:44.772-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="พื้นฐาน"/><title type='text'>Who’s using jQuery?</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #f0f0f0; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: center;&quot;&gt;
&lt;img alt=&quot;&quot; class=&quot;size-full wp-image-1259  aligncenter&quot; height=&quot;356&quot; src=&quot;http://www.jquery.in.th/uploads//2010/11/question-mark.jpg&quot; style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;Who is using jQuery?&quot; width=&quot;237&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
ใครใช้ jQuery บ้าง?? ผมว่าเกือบทุกๆคนที่สนใจใน jQuery หรือภาษาอื่นๆ สิ่งแรกๆเลยที่จะนำมาตัดสินใจว่าจะใช้ในเทคโนโลยีนั้นๆหรือไม่ก็คือ คำถามที่ว่า ใครใช้มันบ้างละ?? jQuery ก็เช่นกัน ตัวผมเองก็ดูว่าทิศทางของ open source ตัวนี้น่าติดตามหรือไม่ มีการพัฒนาต่อไปมากน้อยแค่ใหน กลุ่มคนใช้งานมีแค่ใหน เพราะนั้นมันก็จะหมายถึง การที่เวลาที่เรามีปัญหา เราก็จะสามารถที่จะค้นหาข้อมูลได้อย่างรวดเร็ว นี่ก็เป็นแนวทางเล็กๆน้อยๆ ในการเลือกใช้ open source ครับสำหรับตัวผมเอง&lt;/div&gt;
&lt;div style=&quot;float: none; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: center;&quot;&gt;
&lt;ins style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; display: inline-table; height: 60px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: relative; visibility: visible; width: 468px;&quot;&gt;&lt;ins id=&quot;aswift_1_anchor&quot; style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; display: block; height: 60px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: relative; visibility: visible; width: 468px;&quot;&gt;&lt;iframe allowtransparency=&quot;true&quot; frameborder=&quot;0&quot; height=&quot;60&quot; hspace=&quot;0&quot; id=&quot;aswift_1&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; name=&quot;aswift_1&quot; scrolling=&quot;no&quot; style=&quot;left: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: absolute; top: 0px;&quot; vspace=&quot;0&quot; width=&quot;468&quot;&gt;&lt;/iframe&gt;&lt;/ins&gt;&lt;/ins&gt;&lt;/div&gt;
&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;jQuery นั้นถ้าจะบอกว่าเป็น open source javascript libraries ที่ดังที่สุดในตอนนี้ก็ว่าได้ครับ มีกลุ่มคนใช้งานมากที่สุด และแถมยังมีคน หรือ บริษัทใหญ่ๆนำไปใช้งาน นั้นก็ทำให้เรามั่นใจในความสามารถของ jQuery ไปได้อีก ขนาดเว็บใหญ่ๆเขายังใช้เลย มันต้องมีอะไรดีสิ&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
ข้อดีหลักๆของ jQuery เลยผมต้องยกให้ในเรื่องของตัว selectors เพราะว่าผมใช้งานมันบ่อยมากที่สุดแล้วนะครับ เพราะเราจะทำอะไรก็ต้อง selectors elements นั้นๆมาก่อน ส่วนข้อดีข้อที่สองก็คือ Code ที่สั้นกระชับ รองรับการทำงานในหลายๆ browser และ หลายๆ version ทำให้เขียนทีเดียวก็สามารถที่จะ Run ได้กับทุกๆ Browser เลยก็ว่าได้&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
ด้านล่างนี้ก็เป็นคำตอบของหัวข้อที่ว่า Who is using jQuery?&lt;/div&gt;
&lt;ul style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: none; margin-bottom: 15px; margin-left: 15px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: url(http://www.jquery.in.th/wp-content/themes/alltuts/images/bullet_list.png); background-origin: initial; background-position: 0px 9px; background-repeat: no-repeat no-repeat; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 15px; padding-right: 0px; padding-top: 5px;&quot;&gt;Google&lt;/li&gt;
&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: url(http://www.jquery.in.th/wp-content/themes/alltuts/images/bullet_list.png); background-origin: initial; background-position: 0px 9px; background-repeat: no-repeat no-repeat; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 15px; padding-right: 0px; padding-top: 5px;&quot;&gt;DELL&lt;/li&gt;
&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: url(http://www.jquery.in.th/wp-content/themes/alltuts/images/bullet_list.png); background-origin: initial; background-position: 0px 9px; background-repeat: no-repeat no-repeat; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 15px; padding-right: 0px; padding-top: 5px;&quot;&gt;MLB.com&lt;/li&gt;
&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: url(http://www.jquery.in.th/wp-content/themes/alltuts/images/bullet_list.png); background-origin: initial; background-position: 0px 9px; background-repeat: no-repeat no-repeat; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 15px; padding-right: 0px; padding-top: 5px;&quot;&gt;Digg&lt;/li&gt;
&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: url(http://www.jquery.in.th/wp-content/themes/alltuts/images/bullet_list.png); background-origin: initial; background-position: 0px 9px; background-repeat: no-repeat no-repeat; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 15px; padding-right: 0px; padding-top: 5px;&quot;&gt;NBC.com&lt;/li&gt;
&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: url(http://www.jquery.in.th/wp-content/themes/alltuts/images/bullet_list.png); background-origin: initial; background-position: 0px 9px; background-repeat: no-repeat no-repeat; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 15px; padding-right: 0px; padding-top: 5px;&quot;&gt;CBS.com&lt;/li&gt;
&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: url(http://www.jquery.in.th/wp-content/themes/alltuts/images/bullet_list.png); background-origin: initial; background-position: 0px 9px; background-repeat: no-repeat no-repeat; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 15px; padding-right: 0px; padding-top: 5px;&quot;&gt;Mozilla.org&lt;/li&gt;
&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: url(http://www.jquery.in.th/wp-content/themes/alltuts/images/bullet_list.png); background-origin: initial; background-position: 0px 9px; background-repeat: no-repeat no-repeat; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 15px; padding-right: 0px; padding-top: 5px;&quot;&gt;WordPress&lt;/li&gt;
&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: url(http://www.jquery.in.th/wp-content/themes/alltuts/images/bullet_list.png); background-origin: initial; background-position: 0px 9px; background-repeat: no-repeat no-repeat; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 15px; padding-right: 0px; padding-top: 5px;&quot;&gt;Drupal&lt;/li&gt;
&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://jquery-thaigroup.blogspot.com/feeds/6733831799796431062/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://jquery-thaigroup.blogspot.com/2011/10/whos-using-jquery.html#comment-form' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246208863353533089/posts/default/6733831799796431062'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246208863353533089/posts/default/6733831799796431062'/><link rel='alternate' type='text/html' href='http://jquery-thaigroup.blogspot.com/2011/10/whos-using-jquery.html' title='Who’s using jQuery?'/><author><name>Admin</name><uri>http://www.blogger.com/profile/06932457368166496936</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246208863353533089.post-3281341299918401190</id><published>2011-10-14T22:00:00.001-07:00</published><updated>2011-10-14T22:00:43.151-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="พื้นฐาน"/><title type='text'>วีดีโอสอนการใช้งาน jQuery สำหรับคนที่พึ่งเริ่มต้นครับ</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #f0f0f0; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
Video jQuery นี้มีเป็น Serise เลยครับผมไปเจอมาเลยเอามาฝาก น่าสนใจมากๆสำหรับผู้ที่กำลังเริ่มต้นกับ jQuery ครับ แต่อาจจะต้องฝึกการฟังภาษาอังกฤษนิดหนึ่งนะครับ แต่ก็คงไม่ยากเกินไปสำหรับเพื่อนๆ ช่วงนี้ Google จัดระบบ อันดับ ใหม่ทำให้ jQuery.in.th อันดับตกไปช่วงนี้จะพยายามขยันเขียนบทความให้ได้อ่านกันนะครับ&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
Link VIDEO :&amp;nbsp;&lt;a href=&quot;http://blog.themeforest.net/tutorials/jquery-for-absolute-beginners-video-series/&quot; style=&quot;color: #1fa2e1; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;คลิกที่นี่ครับ&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jquery-thaigroup.blogspot.com/feeds/3281341299918401190/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://jquery-thaigroup.blogspot.com/2011/10/jquery.html#comment-form' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246208863353533089/posts/default/3281341299918401190'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246208863353533089/posts/default/3281341299918401190'/><link rel='alternate' type='text/html' href='http://jquery-thaigroup.blogspot.com/2011/10/jquery.html' title='วีดีโอสอนการใช้งาน jQuery สำหรับคนที่พึ่งเริ่มต้นครับ'/><author><name>Admin</name><uri>http://www.blogger.com/profile/06932457368166496936</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246208863353533089.post-46722625482545390</id><published>2011-10-14T21:59:00.000-07:00</published><updated>2011-10-14T21:59:22.983-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ajax"/><category scheme="http://www.blogger.com/atom/ns#" term="json"/><category scheme="http://www.blogger.com/atom/ns#" term="พื้นฐาน"/><title type='text'>Ajax and JSON ตอนที่ 1</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #f0f0f0; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
ถ้าจะกล่าวถึง jQuery + Ajax แล้วละก็ที่ขาดไม่ได้เลยก็คือ JSON เพราะสามารถนำมาใช้งานได้สะดวกและง่าย เพราะข้อมูลที่เป็นรูปแบบ JSON นั้น Ajax สามารถที่จะเรียกข้อมูลนั้นๆออกมาเป็น Object ได้&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
JSON คืออะไร json นั้นย่อมาจากคำว่า ” JavaScript Object Notation ” จริงๆแล้วข้อมูลที่อยู่ในรูปแบบของ JSON นั้นก็คือ Text ธรรมดาๆครับ เพียงแต่ถูกจัดเรียงให้อยู่ในรูปแบบของ Object Array ถ้าอธิบายวิชาการไปเรื่อยๆนี่สงสัยจะงงกันแน่ๆ มาดูตัวอย่าง รูปแบบของ JSON เลยละกัน&lt;/div&gt;
&lt;div class=&quot;codecolorer-container javascript default&quot; style=&quot;background-color: #f1f1f1; border-bottom-color: rgb(159, 159, 159); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(159, 159, 159); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(159, 159, 159); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(159, 159, 159); border-top-style: solid; border-top-width: 1px; color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: auto; overflow-y: auto; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; white-space: nowrap; width: 580px;&quot;&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;tbody style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;tr style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;line-numbers&quot; style=&quot;background-color: #eeeeee; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-color: rgb(159, 159, 159); border-right-style: solid; border-right-width: 1px; border-style: initial; border-top-width: 0px; color: #888888; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; text-align: right;&quot;&gt;&lt;div style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 23px;&quot;&gt;
1&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;2&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;3&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;4&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;5&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;6&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;7&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;8&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;9&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;10&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;11&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;12&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;13&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;14&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;15&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;16&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;div class=&quot;javascript codecolorer&quot; style=&quot;background-color: #f1f1f1; color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; text-align: left;&quot;&gt;
&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;{&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&quot;firstName&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;:&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&quot;John&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;,&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&quot;lastName&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;:&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&quot;Smith&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;,&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&quot;address&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;:&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;{&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&quot;streetAddress&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;:&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&quot;21 2nd Street&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;,&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&quot;city&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;:&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&quot;New York&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;,&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&quot;state&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;:&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&quot;NY&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;,&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&quot;postalCode&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;:&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;nu0&quot; style=&quot;color: #0080a0; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;10021&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;,&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&quot;phoneNumbers&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;:&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;[&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;{&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&quot;type&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;:&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&quot;home&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;,&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&quot;number&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;:&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&quot;212 555-1234&quot;&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;,&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;{&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&quot;type&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;:&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&quot;fax&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;,&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&quot;number&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;:&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&quot;646 555-4567&quot;&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;}&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;,&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&quot;newSubscription&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;:&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;kw2&quot; style=&quot;color: #2060a0; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;,&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;st0&quot; style=&quot;color: #c03030; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&quot;companyName&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;:&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;kw2&quot; style=&quot;color: #2060a0; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;null&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
ข้อมูลของ JSON นั้นจะถูกห่อหุ้มด้วยเครื่องหมายปีกา { } ดูๆแล้วมันก็เหมือนกับการจับข้อมูลใส่ใน Array ของ PHP นั้นเอง แต่การเรียกใช้งานนั้น AJAX สามารถเรียก json แบบนี้ได้เลย เมื่อ Return ค่ากลับมาในรูปแบบของ JSON&lt;/div&gt;
&lt;div class=&quot;codecolorer-container javascript default&quot; style=&quot;background-color: #f1f1f1; border-bottom-color: rgb(159, 159, 159); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(159, 159, 159); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(159, 159, 159); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(159, 159, 159); border-top-style: solid; border-top-width: 1px; color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: auto; overflow-y: auto; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; white-space: nowrap; width: 580px;&quot;&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;tbody style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;tr style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;line-numbers&quot; style=&quot;background-color: #eeeeee; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-color: rgb(159, 159, 159); border-right-style: solid; border-right-width: 1px; border-style: initial; border-top-width: 0px; color: #888888; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; text-align: right;&quot;&gt;&lt;div style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 23px;&quot;&gt;
1&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;2&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;div class=&quot;javascript codecolorer&quot; style=&quot;background-color: #f1f1f1; color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; text-align: left;&quot;&gt;
jsonData.&lt;span class=&quot;me1&quot; style=&quot;color: #0080ff; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;firstName&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;jsonData.&lt;span class=&quot;me1&quot; style=&quot;color: #0080ff; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Smith&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: black; font: normal normal normal 13px/1.4em Monaco, &#39;Lucida Console&#39;, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
ชนิดของ JSON แบบ Basic มีดังนี้ครับ&lt;/div&gt;
&lt;pre name=&quot;code&quot; style=&quot;padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;- Number
- String
- Boolean (true and false)
- Array
- Object
- null
&lt;/pre&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
วันนี้ก็เอาไว้แค่นี้ก่อนแล้วกันครับเดี๋ยวมาต่อในตอนที่สองอีกทีครับ&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jquery-thaigroup.blogspot.com/feeds/46722625482545390/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://jquery-thaigroup.blogspot.com/2011/10/ajax-and-json-1.html#comment-form' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246208863353533089/posts/default/46722625482545390'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246208863353533089/posts/default/46722625482545390'/><link rel='alternate' type='text/html' href='http://jquery-thaigroup.blogspot.com/2011/10/ajax-and-json-1.html' title='Ajax and JSON ตอนที่ 1'/><author><name>Admin</name><uri>http://www.blogger.com/profile/06932457368166496936</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246208863353533089.post-3449862764269761806</id><published>2011-10-14T21:54:00.000-07:00</published><updated>2011-10-14T21:54:50.924-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ajax"/><category scheme="http://www.blogger.com/atom/ns#" term="พื้นฐาน"/><title type='text'>ajax คืออะไร</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #f0f0f0; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;strong style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Ajax (Asynchronous JavaScript and XML)&lt;/strong&gt;&amp;nbsp;คืออะไร ?&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
Ajax ไม่ใช่ชื่อของการเขียนโปรแกรมหรือเป็นชื่อของภาษาที่ใช้ในการโปรแกรม แต่เป็นชุดของเทคโนโลยีต่างๆ Ajax ย่อมาจาก Asynchronous JavaScript? And XML; ซึ่งหมายถึงการทำงานร่วมกันของ JavaScript? และ XML แบบ Asynchronous มีหลักการทํางาน 2 ประเด็น คือ การ update หน้าจอแบบบางส่วน และการติดต่อสื่อสารกับ Server โดยใช้หลักการ Asynchronous ทําให้ผู้ใช้ไม่ต้องหยุดการทํางาน เพื่อรอการประมวลผลจาก Server รวมถึงการโหลดและการรีเฟรชหน้าจอ ของบราวเซอร์ทางฝั่ง Client มีการใช้ Ajax โดยการเพิ่มเลเยอร์ระหว่าง user browser กับ server ทําให้ผู้ใช้สามารถทํางานได้โดยไม่ต้องรอให้ Client ติดต่อไปยัง Server รวมถึงการโหลดและการรีเฟรชหน้าจอทั้งหมดด้วย ดังนั้นผู้ใช้สามารถใช้งาน application ได้อย่างมีประสิทธิภาพมากขึ้น&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
AJAX จึงไม่ใช่เทคโนโลยีในตัวของมันเอง แต่ว่าเป็นการนำเทคโนโลยีหลายๆ ตัวมารวมกันเช่น JavaScript?, DHTML, XML, Css, Dom และ XMLHTTPRequest&lt;/div&gt;
&lt;div style=&quot;float: none; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: center;&quot;&gt;
&lt;ins style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; display: inline-table; height: 60px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: relative; visibility: visible; width: 468px;&quot;&gt;&lt;ins id=&quot;aswift_1_anchor&quot; style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; display: block; height: 60px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: relative; visibility: visible; width: 468px;&quot;&gt;&lt;iframe allowtransparency=&quot;true&quot; frameborder=&quot;0&quot; height=&quot;60&quot; hspace=&quot;0&quot; id=&quot;aswift_1&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; name=&quot;aswift_1&quot; scrolling=&quot;no&quot; style=&quot;left: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: absolute; top: 0px;&quot; vspace=&quot;0&quot; width=&quot;468&quot;&gt;&lt;/iframe&gt;&lt;/ins&gt;&lt;/ins&gt;&lt;/div&gt;
&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;Ajax engine ทำหน้าที่เป็นตัวกลางระหว่าง client และ server ฉะนั้นเมื่อ client มี requestแทนที่จะส่ง HTTP request ไปยัง server โดยตรง client จะส่ง JavaScript? call ไปยัง Ajax engine เพื่อโหลดข้อมูลที่ user ต้องการ และหาก Ajax engine ต้องการข้อมูลเพิ่มเติมในการตอบสนองต่อ user Ajax engine จะส่ง request ไปยัง server โดยใช้ XML&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
การ์เรตได้กล่าวถึงเทคโนโลยีต่าง ๆ ที่เป็นส่วนประกอบของ Ajax ซึ่งได้แก่&lt;/div&gt;
&lt;ul style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: none; margin-bottom: 15px; margin-left: 15px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: url(http://www.jquery.in.th/wp-content/themes/alltuts/images/bullet_list.png); background-origin: initial; background-position: 0px 9px; background-repeat: no-repeat no-repeat; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 15px; padding-right: 0px; padding-top: 5px;&quot;&gt;HTML/XHTML เป็นภาษาในการจัดแสดงข้อมูล&lt;/li&gt;
&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: url(http://www.jquery.in.th/wp-content/themes/alltuts/images/bullet_list.png); background-origin: initial; background-position: 0px 9px; background-repeat: no-repeat no-repeat; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 15px; padding-right: 0px; padding-top: 5px;&quot;&gt;CSS เป็นรูปแบบการจัดแต่ง XHTML&lt;/li&gt;
&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: url(http://www.jquery.in.th/wp-content/themes/alltuts/images/bullet_list.png); background-origin: initial; background-position: 0px 9px; background-repeat: no-repeat no-repeat; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 15px; padding-right: 0px; padding-top: 5px;&quot;&gt;Document Object Model (DOM) สำหรับ dynamic display and interaction&lt;/li&gt;
&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: url(http://www.jquery.in.th/wp-content/themes/alltuts/images/bullet_list.png); background-origin: initial; background-position: 0px 9px; background-repeat: no-repeat no-repeat; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 15px; padding-right: 0px; padding-top: 5px;&quot;&gt;XML เป็นรูปแบบการแลกเปลี่ยนดาต้า&lt;/li&gt;
&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: url(http://www.jquery.in.th/wp-content/themes/alltuts/images/bullet_list.png); background-origin: initial; background-position: 0px 9px; background-repeat: no-repeat no-repeat; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 15px; padding-right: 0px; padding-top: 5px;&quot;&gt;XSLT สำหรับ แปลง XML เป็น XHTML&lt;/li&gt;
&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: url(http://www.jquery.in.th/wp-content/themes/alltuts/images/bullet_list.png); background-origin: initial; background-position: 0px 9px; background-repeat: no-repeat no-repeat; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 15px; padding-right: 0px; padding-top: 5px;&quot;&gt;XMLHTTPRequest สำหรับ asynchronous data retrieval&lt;/li&gt;
&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: url(http://www.jquery.in.th/wp-content/themes/alltuts/images/bullet_list.png); background-origin: initial; background-position: 0px 9px; background-repeat: no-repeat no-repeat; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 15px; padding-right: 0px; padding-top: 5px;&quot;&gt;JavaScript? เป็นภาษาในการใช้งาน Ajax engine&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
โดยส่วนประกอบจำเป็นขั้นพื้นฐานที่ขาดไม่ได้ใน Ajax ได้แก่ HTML/XHTML DOM และ JavaScript? เพราะ XHTML&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;strong style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;ประวัติความเป็นมา&lt;/strong&gt;&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;ในช่วงแรกๆของการพัฒนา คือปี 1997 นั้น Component แรกที่เกิดขึ้นทางฝั่ง Client ถูกเขียนขึ้นโดยทีมพัฒนา Outlook Web Access ซึ่งต่อมาถูกนำมาใช้เป็นส่วนหนึ่งของ Internet Explorer 5.0 นั่นก็คือจุดเริ่มต้นที่เริ่มรู้จักการทำงานแบบ Ajax และในปี 2005 Google ได้ใช้การติดต่อสื่อสารแบบ Asynchronous เพื่อเป็นรากฐานที่ทำให้รู้จักกับ Ajax กันอย่างแพร่หลาย การทำงานแบบ Client – Server ถูกนำมาใช้งานเป็นจำนวนมาก เช่น การติดต่อกับฐานข้อมูลที่ Server หรือการให้บริการทางอินเตอร์เน็ต ซึ่ง Google เป็นผู้ลงทุนลงแรงอย่างหนัก ในพัฒนาและการทดสอบ Ajax จึงสังเกตได้ว่า ผลผลิตใหญ่ของ Google ในช่วงต้นปี 2005 จึงเป็นการนำ Ajax มาประยุกต์ใช้งาน เช่น Gmail, GoogleMap?, GoogleSuggest? และ GoogleGroup? เป็นต้น&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;strong style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;ที่มาของปัญหา&lt;/strong&gt;&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;เนื่องจากแอพลิเคชั่นที่ใช้งานในปัจจุบันนี้ มีหลักการที่ทำงานแล้วเกิดการสูญเสียเวลาและทรัพยากรของผู้ใช้ในการรอคอยการ ทำงานต่างๆ ทำให้ผู้ใช้ต้องหยุดคอย ดังนั้นการทำงานของผู้ใช้จึงเป็นไปอย่างไม่ต่อเนื่อง ซึ่งหลักการดังกล่าวคือ&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;span style=&quot;color: maroon; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;strong style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;1.”Click, wait, and refresh” user interaction paradigm&lt;/strong&gt;&lt;/span&gt;&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;การที่บราวเซอร์ตอบสนองต่อการทำงานของผู้ใช้ โดยจะทิ้งหน้าเว็บที่แสดงอยู่ในขณะนั้น แล้วไปทำการส่ง HTTP request กลับไปยัง server แทน ซึ่งทำให้ผู้ใช้ไม่สามารถทำอะไรได้เลยในขณะนั้น นอกจากการรอคอย เมื่อ server ทำการประมวลเสร็จก็จะส่งหน้า HTML กลับมายังบราวเซอร์ ต่อจากนั้นบราวเซอร์ก็จะรีเฟรชและแสดงหน้า HTML หน้าใหม่ และนี้เองที่ทำให้ผู้ใช้สามารถใช้งานต่อไปได้&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;จะเห็นว่า ผู้ใช้มีช่วงเวลาของการหยุดรอคอยเป็นเวลานานสำหรับการประมวลผลของ Server และการรีเฟรชหน้า HTML ใหม่ทั้งหน้า ซึ่งเป็นสิ่งที่ไม่มีประสิทธิภาพในเชิง Dynamic ของการทำงานบนเว็บแอพลิเคชั่น&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&lt;strong style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&lt;span style=&quot;color: maroon; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;2.Synchronous “request/response” communication mode&lt;/span&gt;&lt;/strong&gt;&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;การที่บราวเซอร์เริ่มทำการร้องขอข้อมูล และ server ก็ตอบสนองเฉพาะการร้องขอที่บราวเซอร์ร้องขอมา server จะไม่สามารถส่งข้อมูลได้ถ้าบราวเซอร์ไม่ได้ร้องขอข้อมูลในขณะนั้น ซึ่งถือว่าเป็นการติดต่อสื่อสารเป็นแบบทิศทางเดียว&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;วงจรการ request/response แบบ synchronous คือ การทำงานแบบประสานจังหวะระหว่างบราวเซอร์กับ Server ทำให้เกิดความล่าช้าในการทำงานทำให้ผู้ใช้ทำอะไรไม่ได้อีก นอกจากการคอยการตอบสนองกลับมาจาก server เมื่อ server ประมวลผลเสร็จ&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;strong style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span style=&quot;color: maroon; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;ข้อดีของ Ajax&lt;/span&gt;&lt;/strong&gt;&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;1. ตอบสนองต่อผู้ใช้ได้อย่างรวดเร็วเนื่องจากการ update แบบบางส่วน&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;2. ผู้ใช้ไม่ต้องหยุดรอคอยการประมวลของ server เนื่องจากการติดต่อแบบ Asynchronous&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;3. รองรับกับบราวเซอร์หลักๆที่สามารถใช้ JavaScript? ได้&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;4. ทำให้การประมวลผลที่ Server มีความรวดเร็วขึ้นเนื่องจากการประมวลผลที่ Server ลดลง&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;5. ไม่ต้องทำการติดตั้ง หรือใช้ Plugs-in&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;6. ไม่ยึดติดกับ Platform หรือภาษาที่ใช้ในการเขียนโปรแกรม&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;7. เป็นเ ทคโนโลยีใหม่ที่ไม่ได้เป็นของนักพัฒนาเว็บแอพลิเคชั่นคนใด นั่นคือทุกคนมีสิทธิ์เข้ามาพัฒนาแอพลิเคชั่นตัวนี้&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
ที่มาของข้อมูลนี้ : http://wiki.nectec.or.th/setec/Knowledge/Ajax สามารถอ่านเพิ่มเติมได้ตาม link นี้&lt;/div&gt;
&lt;div style=&quot;float: none; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: center;&quot;&gt;
&lt;ins style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; display: inline-table; height: 60px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: relative; visibility: visible; width: 468px;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jquery-thaigroup.blogspot.com/feeds/3449862764269761806/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://jquery-thaigroup.blogspot.com/2011/10/ajax.html#comment-form' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246208863353533089/posts/default/3449862764269761806'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246208863353533089/posts/default/3449862764269761806'/><link rel='alternate' type='text/html' href='http://jquery-thaigroup.blogspot.com/2011/10/ajax.html' title='ajax คืออะไร'/><author><name>Admin</name><uri>http://www.blogger.com/profile/06932457368166496936</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246208863353533089.post-8767462486018208775</id><published>2011-10-14T21:50:00.000-07:00</published><updated>2011-10-14T21:53:08.274-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="แก้ไข"/><title type='text'>การทำงานแบบ Client-side และ server-side คืออะไร</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #f0f0f0; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
ในการทำงานด้าน Web Programming ในการเขียนโปรแกรมนั้น จะถูกแยกการทำงานออกเป็นสองแบบหลักๆ คือ Client-side และ Server-side ในการเขียนโปรแกรมแบบ Server-side นั้นก็ได้แก่ภาษา php, java jsp,&amp;nbsp; .NET เป็นต้น ซึ่งการเขียนโปรแกรมด้วยภาษาเหล่านี้ จะเป็นการ Run โปรแกรม ในฝั่งของ Server แล้ว return ค่า หรือ แสดงผลกลับมาทาง Client ในที่นี้หมายถึง web browser ต่างๆเช่น IE, Firefox, safari&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
ตัวอย่างการทำงานแบบ Server-side:&lt;/div&gt;
&lt;h5 style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;

client เรียก www.google.com –&amp;gt; Server google ประมวลผล —&amp;gt; ส่งค่ากลับไปให้ที่ Client&lt;/h5&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
จากตัวอย่างเป็นการเรียก เว็บ Google ผ่าน browser เมื่อมีการเรียก URL ดังกล่าว Client จะทำการส่งคำขอไปทาง server ของ google เมื่อมีการตอบรับ จาก server ของ google ก็จะทำตามคำสั่งที่เขียนใว้ที่ server และจะประมวลผล และส่งค่ากลับมายัง browser ที่ทำการร้องขอไป&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
ส่วนการทำงานแบบ Client Side นั้นเป็นการประมวลผลทางฝั่ง Browser ภาษาที่ใช้ก็เช่น javascript ประโยชน์ของการทำงานฝั่ง Client นั้นก็มีเยอะเลยครับ คือแทนที่เราจะส่งทุกๆอย่างไปประมวลผลที่ server เราก็มาประมวลผลที่ client ก่อนแล้วค่อยส่งบางส่วนไปประมวลที่ server ซึ่งจะช่วยในเรื่องของความเร็วในการทำงานได้มาก และ ลด Load ของ Server ลงได้เยอะมากๆ เพราะการทำงานฝั่ง client นั้นจะประมวลผลที่เครื่องของ user เอง&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
ผมจะยกตัวอย่างการทำงานแบบ server side และ client side ให้ดูเพื่อให้ห็นความแตกต่างกัน&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;strong style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;ตัวอย่าง code การทำงานแบบ Server-side (server.php)&lt;/strong&gt;&lt;/div&gt;
&lt;div style=&quot;float: none; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: center;&quot;&gt;
&lt;strong style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;ins style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; display: inline-table; height: 60px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: relative; visibility: visible; width: 468px;&quot;&gt;&lt;/ins&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;ins id=&quot;aswift_1_anchor&quot; style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; display: block; height: 60px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: relative; visibility: visible; width: 468px;&quot;&gt;&lt;/ins&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;iframe allowtransparency=&quot;true&quot; frameborder=&quot;0&quot; height=&quot;60&quot; hspace=&quot;0&quot; id=&quot;aswift_1&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; name=&quot;aswift_1&quot; scrolling=&quot;no&quot; style=&quot;left: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: absolute; top: 0px;&quot; vspace=&quot;0&quot; width=&quot;468&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;
&lt;strong style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;/div&gt;
&lt;pre class=&quot;php&quot; name=&quot;code&quot; style=&quot;padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;lt;form name=&quot;server-side&quot; action=&quot;server.php&quot;&amp;gt;
           &amp;lt;input type=&quot;text&quot; name=&quot;myName&quot; &amp;gt;
           &amp;lt;input type=&quot;submit&quot; value=&quot;submit&quot; /&amp;gt;
&amp;lt;/form&amp;gt;

&amp;lt;?php

if( isset($_POST[&quot;myName&quot;]) )
{
   if($_POST[&quot;myName&quot;] == &quot;&quot;)
   {
        echo &quot; Please key in your name. &quot;;
        exit();
   } else
   {
        echo &quot;OK&quot;;
   }
}
?&amp;gt;&lt;/pre&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
จากตัวอย่างด้านบนนี้เป็นการส่งค่า ไปยัง script server.php โดยตรง โดยเป็นการประมวลผลทางฝั่ง Server (server side) จะเห็นได้ว่า เมื่อกด submit ไปแล้ว โปรแกรมจะทำการเช็คว่า มีการกรอกค่าใน form มาหรือไม่ ถ้าค่าว่างจะแสดงข้อความ Error ออกมาพร้อมทั้งให้กลับไปกรอกใหม่ จะเห็นว่ามันเป็นการทำงานที่เพิ่มโหลดให้กับ Server เพราะจะต้องมาทำการเช็คค่า ว่าว่าง หรือเปล่า ถ้าหากเป็นระบบที่มีการใช้งานที่ต้องรองรับจำนวนคนมากๆ อันนี้มีปัญหาแน่ๆครับ แต่ที่ผมยกตัวอย่างมานี้เป็นแค่ตัวอย่างง่ายๆ ซึ่ง script แค่นี้คงไม่ทำให้ server โหลดถึงขนาดล่มไปได้ แต่ถ้าเราเปลี่ยนวิธีการแบบนี้ มาเป็นการใช้ Client side ช่วยละ เป็นอีกวิธีหนึ่งเลยนะครับ ที่จะลดขึ้นตอนการทำงานของ Server ลงได้เยอะเลย มาดูตัวอย่างกัน&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;strong style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;ตัวอย่าง code การทำงานแบบ Client Side :&lt;/strong&gt;&lt;/div&gt;
&lt;pre class=&quot;html&quot; name=&quot;code&quot; style=&quot;padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;lt;form name=&quot;server-side&quot; action=&quot;server.php&quot; onSubmit=&quot; return checkForm(); &quot;&amp;gt;
&amp;lt;input id=&quot;myName&quot; type=&quot;text&quot; name=&quot;myName&quot; &amp;gt;
&amp;lt;input type=&quot;submit&quot; value=&quot;submit&quot; /&amp;gt;
&amp;lt;/form&amp;gt;

&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;
function checkForm(){
      if( $(&quot;#myName&quot;).attr(&quot;value&quot;) == &quot;&quot; ) {
            alert(&quot;Please key in your name.&quot;);
            return false;
      }else{
            return true;
      }
}
&amp;lt;/script&amp;gt;&lt;/pre&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
จาก code ตัวอย่างด้านบนนี้ เป็นการใช้ ภาษา javascript เช็คค่าของ input box ว่ามีค่าว่างหรือไม่ ถ้ามีค่าว่างจะ alert ข้อความออกมาแจ้งว่าให้กรอกชื่อคุณ จะเห็นได้ว่าวิธีแบบ client side นี้ลดโหลดหรือลดการทำงานทางฝั่ง server ได้พอสมควรเลยแทนที่เราจะส่งค่าไปเช็คด้วยโปรแกรมทางฝั่ง server เราก็ทำการเช็คค่าก่อนทำการส่ง ถ้าค่าถูกต้องตามที่ต้องการแล้วเราค่อยส่งค่าไปประมวลผล แบบนี้ก็เป็นวิธีที่ดีทีเดียว&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;strong style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Tips :&lt;/strong&gt;&amp;nbsp;ในการออกแบบระบบนั้น ถ้าเราแยกการประมวลผลออกได้ว่าอันใหนควรจะทำที่ browser อันใหน ควรจะส่งไประมวลผลที่ server จะทำให้โปรแกรมที่เราพัฒนาขึ้นมานั้นมีประสิทธิภาพมากยิ่งขึ้น ซึ่งสิ่งเหล่านี้ก็ขึ้นอยู่กับการสะสมประสพการณ์ของแต่ละคนครับ&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jquery-thaigroup.blogspot.com/feeds/8767462486018208775/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://jquery-thaigroup.blogspot.com/2011/10/client-side-server-side.html#comment-form' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246208863353533089/posts/default/8767462486018208775'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246208863353533089/posts/default/8767462486018208775'/><link rel='alternate' type='text/html' href='http://jquery-thaigroup.blogspot.com/2011/10/client-side-server-side.html' title='การทำงานแบบ Client-side และ server-side คืออะไร'/><author><name>Admin</name><uri>http://www.blogger.com/profile/06932457368166496936</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246208863353533089.post-2692763434642186726</id><published>2011-10-14T21:47:00.001-07:00</published><updated>2011-10-14T21:52:34.161-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="พื้นฐาน"/><title type='text'>What is jQuery ?</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #f0f0f0; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
แน่นอนอยู่แล้วว่า ก่อนที่ใครจะศึกษาอะไร เอาก็ต้องมีคำถามในใจเหมือนกันทุกๆคนว่า ที่เราจะศึกษาเนี่ยมันคืออะไร? มันใช้ทำอะไร มีประโยชน์อย่างไร เท่าที่ผมได้ลองใช้ jQuery ในหลายๆงาน ทำให้รู้ถึงข้อดีหลายๆอย่างของ jQuery ผมก็จะมาเล่นสู่กันฟังก็แล้วกันครับ จะได้ดูไม่เครียด เข้าใจง่าย&lt;br /&gt;
&lt;strong style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&lt;span style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: underline;&quot;&gt;jQuery คืออะไร&lt;/span&gt;&amp;nbsp;?&lt;/strong&gt;&lt;br /&gt;
jQuery นั้นเป็น JavaScript Library ที่บรรจุเอา Function และ คำสั่งต่างๆ ที่จะทำให้เราๆท่านๆ ไม่ต้องมาเขียนเองใหม่ทั้งหมดตั้งแต่ต้น เราสามารถที่จะเขียน ajax ได้แบบง่ายๆเพียง code ไม่กี่บรรทัด หรือจะเขียน javascript เพื่อดัก Event (เหตุการณ์) ต่างๆที่เขาต้องการ เช่น การ click, rollover, mouse moved อื่นๆอีกมากหมาย ซึ่งถ้าเขียนเองทั้งหมดตั้งแต่ต้นละก็ รับลองได้เลย หลายบรรทัดแน่นอน เวลามาแก้ code ทีหลังนี่เล่นเอาปวดกระบานไปหลายวันเลยละ (จากประสพการณ์จริงเลย)&lt;/div&gt;
&lt;div style=&quot;float: none; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: center;&quot;&gt;
&lt;ins style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; display: inline-table; height: 60px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: relative; visibility: visible; width: 468px;&quot;&gt;&lt;/ins&gt;&lt;br /&gt;
&lt;ins id=&quot;aswift_1_anchor&quot; style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; display: block; height: 60px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: relative; visibility: visible; width: 468px;&quot;&gt;&lt;/ins&gt;&lt;br /&gt;
&lt;iframe allowtransparency=&quot;true&quot; frameborder=&quot;0&quot; height=&quot;60&quot; hspace=&quot;0&quot; id=&quot;aswift_1&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; name=&quot;aswift_1&quot; scrolling=&quot;no&quot; style=&quot;left: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: absolute; top: 0px;&quot; vspace=&quot;0&quot; width=&quot;468&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;strong style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: underline;&quot;&gt;jQuery เอามาทำอะไรได้บ้างละ&lt;/span&gt;&amp;nbsp;?&lt;/strong&gt;&lt;br /&gt;
เมื่อถามว่ามันทำอะไรได้บ้าง ก็ทำได้หลายอย่างมากหลายเลยละ ไม่ว่าจะเป็นการ&lt;/div&gt;
&lt;ul style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: none; margin-bottom: 15px; margin-left: 15px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: url(http://www.jquery.in.th/wp-content/themes/alltuts/images/bullet_list.png); background-origin: initial; background-position: 0px 9px; background-repeat: no-repeat no-repeat; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 15px; padding-right: 0px; padding-top: 5px;&quot;&gt;&lt;span style=&quot;color: navy; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;ความสามารถในการทำงานแบบ ajax&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: url(http://www.jquery.in.th/wp-content/themes/alltuts/images/bullet_list.png); background-origin: initial; background-position: 0px 9px; background-repeat: no-repeat no-repeat; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 15px; padding-right: 0px; padding-top: 5px;&quot;&gt;&lt;span style=&quot;color: navy; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;การสร้าง animation ได้แบบง่ายๆเลย ไม่ว่าจะทำรูปให้เคลื่อนที่ หรือ DIV เช่นเอา mouse จับ DIV ลากไปมา&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: url(http://www.jquery.in.th/wp-content/themes/alltuts/images/bullet_list.png); background-origin: initial; background-position: 0px 9px; background-repeat: no-repeat no-repeat; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 15px; padding-right: 0px; padding-top: 5px;&quot;&gt;&lt;span style=&quot;color: navy; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;ความสามารถในการ binds หรือการผูก หรือจับ function ที่เขาเขียนขึ้นให้ทำงานร่วมกับ function อื่นๆ&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: url(http://www.jquery.in.th/wp-content/themes/alltuts/images/bullet_list.png); background-origin: initial; background-position: 0px 9px; background-repeat: no-repeat no-repeat; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 15px; padding-right: 0px; padding-top: 5px;&quot;&gt;&lt;span style=&quot;color: navy; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;สามารถจัดการกับ css (style sheet) ลอง element นั้นๆได้&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: url(http://www.jquery.in.th/wp-content/themes/alltuts/images/bullet_list.png); background-origin: initial; background-position: 0px 9px; background-repeat: no-repeat no-repeat; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 15px; padding-right: 0px; padding-top: 5px;&quot;&gt;&lt;span style=&quot;color: navy; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;ค้นหา element ที่เราต้องการและจัดการ เพิ่มหรือลบ Attributes ที่เราต้องการได้&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: url(http://www.jquery.in.th/wp-content/themes/alltuts/images/bullet_list.png); background-origin: initial; background-position: 0px 9px; background-repeat: no-repeat no-repeat; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 15px; padding-right: 0px; padding-top: 5px;&quot;&gt;&lt;span style=&quot;color: navy; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;ทำ Effect ต่างๆกับ Element ที่เราต้องการ เช่นการ hide DIV ที่เราต้องการ&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: url(http://www.jquery.in.th/wp-content/themes/alltuts/images/bullet_list.png); background-origin: initial; background-position: 0px 9px; background-repeat: no-repeat no-repeat; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 15px; padding-right: 0px; padding-top: 5px;&quot;&gt;&lt;span style=&quot;color: navy; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;การดักเหตุการณ์ต่างๆ&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;strong style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;jQuery&lt;/strong&gt;&amp;nbsp;นั้นมี Plugin มากหลายเลยที่เราสามารถนำมาใช้ในงานของเราได้ ผมเองก็ได้ประโยชน์จาก jQuery Plugin เยอะพอสมควรเลยสำหรับงานรีบๆ ไม่ว่าจะเป็น Plugin สำหรับการเช็ค Form เช่น เช็ค email ว่ารูปแบบถูกต้องหรือไม่ หรือ plugin ปฏิทิน อันนี้ใช้บ่อยมาก ใช้สำหรับให้ user คลิกเลือกวันที่เอา โดยไม่ต้องมากรอกเอง หรือไม่ว่าจะเป็นการดึงเอาข้อมูล XML , JSON, TEXT ก็สามารถทำได้ง่ายๆเลย&lt;/div&gt;
&lt;div style=&quot;line-height: 18px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
ส่วนวิธีการใช้งาน หรือการติดตั้งนั้น เพื่อนๆสามารถอ่านได้ในบทความ ต่อไปที่จะเขียนอธิบายถึงวิธีติดตั้ง jQuery เพื่อนำมาใช้งาน และ บทความ ที่จะอธิบายคำว่า DOM คืออะไร เพื่อให้เข้าใจการทำงานของ jQuery ได้ง่ายยิ่งขึ้น&lt;/div&gt;
&lt;div style=&quot;float: none; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: center;&quot;&gt;
&lt;ins style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; display: inline-table; height: 60px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: relative; visibility: visible; width: 468px;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jquery-thaigroup.blogspot.com/feeds/2692763434642186726/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://jquery-thaigroup.blogspot.com/2011/10/what-is-jquery.html#comment-form' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246208863353533089/posts/default/2692763434642186726'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246208863353533089/posts/default/2692763434642186726'/><link rel='alternate' type='text/html' href='http://jquery-thaigroup.blogspot.com/2011/10/what-is-jquery.html' title='What is jQuery ?'/><author><name>Admin</name><uri>http://www.blogger.com/profile/06932457368166496936</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>