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

<channel>
	<title>oue&#039;s profile &#187; Javascript</title>
	<atom:link href="http://www.aspgod.com/tag/javascript/feed" rel="self" type="application/rss+xml" />
	<link>http://www.aspgod.com</link>
	<description>AI algorithm graphics programming blog Firefox ff</description>
	<lastBuildDate>Fri, 20 Jan 2012 16:59:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>Using JSON with Google Data APIs</title>
		<link>http://www.aspgod.com/api/using-json-with-google-data-apis.html</link>
		<comments>http://www.aspgod.com/api/using-json-with-google-data-apis.html#comments</comments>
		<pubDate>Wed, 10 Aug 2011 04:33:28 +0000</pubDate>
		<dc:creator>aspgod</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[youtube api]]></category>

		<guid isPermaLink="false">http://www.aspgod.com/?p=624</guid>
		<description><![CDATA[สำหรับบางคนที่ต้องการเขียนโปรแกรมไปเรียกใช้ API ของ Google หรือ Youtube ก็ตาม สามารถเรียกข้อมูลมาเป็น XML หรือ JSON ก็ได้ ตัวอย่างข้อมูล Link ที่ใช้เรียก API เช่น https://gdata.youtube.com/feeds/api/users/dreamusic/uploads ให้เราใส่ query string ตามหลังไป ?alt= โดยพารามิเตอร์ก็จะมี atom, rss, json, json-in-script, and jsonc. ในที่นี้ให้ใช้ json https://gdata.youtube.com/feeds/api/users/dreamusic/uploads?alt=json ก็จะได้ข้อมูลออกมาเป็น json แต่สำหรับใครที่เรียกใช้งาน API นี้ด้วย Javascript ก็จะติดปัญหา Cross Domain ให้แก้ด้วยการใส่เป็น json-in-script https://gdata.youtube.com/feeds/api/users/dreamusic/uploads?alt=json-in-script สามารถดูตัวอย่างโค๊ดที่เรียกใช้งานได้ตามนี้ครับ http://code.google.com/apis/gdata/docs/json.html Related posts: Get Youtube Videos uploaded by a [...]
Related posts:<ol>
<li><a href='http://www.aspgod.com/internet-technology/videos-uploaded-by-a-specific-user.html' rel='bookmark' title='Get Youtube Videos uploaded by a specific user'>Get Youtube Videos uploaded by a specific user</a> <small>มาว่ากันด้วยเรื่องของ Youtube API กันต่อ มาคราวนี้เป็นการเรียกดูว่า user คนนี้ได้เคย upload วีดีโออะไรไว้บ้าง เช่น...</small></li>
<li><a href='http://www.aspgod.com/internet-technology/retrieve-single-youtube-video-information.html' rel='bookmark' title='Retrieve Single Youtube Video Information'>Retrieve Single Youtube Video Information</a> <small>ต่อเนื่องมาจากการใช้งาน Youtube API นี่เป็นวิธีการในดึงข้อมูลของ Youtube Video มาใช้งาน เช่น title, description,...</small></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>สำหรับบางคนที่ต้องการเขียนโปรแกรมไปเรียกใช้ API ของ Google หรือ Youtube ก็ตาม สามารถเรียกข้อมูลมาเป็น XML หรือ JSON ก็ได้<br />
ตัวอย่างข้อมูล Link ที่ใช้เรียก API เช่น</p>
<blockquote><p>https://gdata.youtube.com/feeds/api/users/dreamusic/uploads</p></blockquote>
<p>ให้เราใส่ query string ตามหลังไป <strong>?alt=</strong> โดยพารามิเตอร์ก็จะมี atom, rss, json, json-in-script, and jsonc. ในที่นี้ให้ใช้ json</p>
<blockquote><p>https://gdata.youtube.com/feeds/api/users/dreamusic/uploads?alt=json</p></blockquote>
<p>ก็จะได้ข้อมูลออกมาเป็น json แต่สำหรับใครที่เรียกใช้งาน API นี้ด้วย Javascript ก็จะติดปัญหา Cross Domain ให้แก้ด้วยการใส่เป็น json-in-script</p>
<blockquote><p>https://gdata.youtube.com/feeds/api/users/dreamusic/uploads?alt=json-in-script</p></blockquote>
<p>สามารถดูตัวอย่างโค๊ดที่เรียกใช้งานได้ตามนี้ครับ <a href="http://code.google.com/apis/gdata/docs/json.html">http://code.google.com/apis/gdata/docs/json.html </a></p>
<p>Related posts:<ol>
<li><a href='http://www.aspgod.com/internet-technology/videos-uploaded-by-a-specific-user.html' rel='bookmark' title='Get Youtube Videos uploaded by a specific user'>Get Youtube Videos uploaded by a specific user</a> <small>มาว่ากันด้วยเรื่องของ Youtube API กันต่อ มาคราวนี้เป็นการเรียกดูว่า user คนนี้ได้เคย upload วีดีโออะไรไว้บ้าง เช่น...</small></li>
<li><a href='http://www.aspgod.com/internet-technology/retrieve-single-youtube-video-information.html' rel='bookmark' title='Retrieve Single Youtube Video Information'>Retrieve Single Youtube Video Information</a> <small>ต่อเนื่องมาจากการใช้งาน Youtube API นี่เป็นวิธีการในดึงข้อมูลของ Youtube Video มาใช้งาน เช่น title, description,...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.aspgod.com/api/using-json-with-google-data-apis.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OnClientClick with Validation in ASP.Net</title>
		<link>http://www.aspgod.com/aspnet/onclientclick-with-validation-in-asp-net.html</link>
		<comments>http://www.aspgod.com/aspnet/onclientclick-with-validation-in-asp-net.html#comments</comments>
		<pubDate>Fri, 26 Mar 2010 06:30:11 +0000</pubDate>
		<dc:creator>aspgod</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[confirm]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[OnClientClick]]></category>
		<category><![CDATA[Page_ClientValidate]]></category>
		<category><![CDATA[Validation]]></category>

		<guid isPermaLink="false">http://www.aspgod.com/?p=491</guid>
		<description><![CDATA[เมื่อ input ต้องการ validate รวมถึงการ confirm พร้อมๆกันจะทำอย่างไร ในเมื่อการใส่อย่างใดอย่างหนึ่งก็สามารถทำงานได้ในตัวของมันเอง แต่หากนำมันมารวมกัน ก็จะพบว่าการ validate input นั้นไม่ทำงาน มีวิธีการแก้ไข 2 วิธี 1. ให้ alert confirm input ก่อน แล้วค่อยทำการ validate วิธีนี้ต้องใส่โค๊ดด้านล่างไว้ที่ Page_Load btnSubmit.Attributes.Add&#40;&#34;onclick&#34;, &#34;if(confirm('do this ?') == false) return false;&#34;&#41;; 2. ให้ validate ก่อน แล้วค่อย alert confirm input ให้ใส่โค๊ดนี้ในส่วนของ asp:Button OnClientClick=&#34;if (Page_ClientValidate('vd1')){return confirm('Are you sure you want to perform this action?')}&#34; [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.aspgod.com/wp-content/uploads/2010/03/26-3-2553-13-10-12.png"><img class="aligncenter size-full wp-image-492" title="OnClientClick with Validation in ASP.Net" src="http://www.aspgod.com/wp-content/uploads/2010/03/26-3-2553-13-10-12.png" alt="OnClientClick with Validation on ASP.Net" width="297" height="66" /></a></p>
<p>เมื่อ input ต้องการ validate รวมถึงการ confirm พร้อมๆกันจะทำอย่างไร ในเมื่อการใส่อย่างใดอย่างหนึ่งก็สามารถทำงานได้ในตัวของมันเอง แต่หากนำมันมารวมกัน ก็จะพบว่าการ validate input นั้นไม่ทำงาน</p>
<p><a href="http://www.aspgod.com/wp-content/uploads/2010/03/26-3-2553-13-18-00.png"><img class="aligncenter size-full wp-image-493" title="OnClientClick with Validation in ASP.Net" src="http://www.aspgod.com/wp-content/uploads/2010/03/26-3-2553-13-18-00.png" alt="OnClientClick with Validation in ASP.Net" width="580" height="50" /></a></p>
<p><strong>มีวิธีการแก้ไข 2 วิธี</strong><br />
1. ให้ alert confirm input ก่อน แล้วค่อยทำการ validate วิธีนี้ต้องใส่โค๊ดด้านล่างไว้ที่ Page_Load</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">btnSubmit.<span style="color: #660066;">Attributes</span>.<span style="color: #660066;">Add</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;onclick&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;if(confirm('do this ?') == false) return false;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>2. ให้ validate ก่อน แล้วค่อย alert confirm input ให้ใส่โค๊ดนี้ในส่วนของ asp:Button</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">OnClientClick<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;if (Page_ClientValidate('vd1')){return confirm('Are you sure you want to perform this action?')}&quot;</span></pre></div></div>

<p><a href="http://www.aspgod.com/wp-content/uploads/2010/03/26-3-2553-14-26-54.png"><img class="aligncenter size-full wp-image-503" title="OnClientClick with Validation in ASP.Net" src="http://www.aspgod.com/wp-content/uploads/2010/03/26-3-2553-14-26-54.png" alt="OnClientClick with Validation in ASP.Net" width="561" height="76" /></a><br />
สำหรับ page ไหนที่มี ValidationGroup หลายตัว ให้ใส่ชื่อ group นั้นใน Page_ClientValidate(&#8216;&#8230;.&#8217;) ด้วย แต่ถ้ามี group เดียวก็ปล่อยว่างได้ครับ<br />
สามารถอธิบายในส่วน if (Page_ClientValidate()) ได้ว่า ถ้าผ่านการ validate เรียบร้อยแล้ว จะทำงานในส่วนของภายใน if ดังนั้นถ้า validate ไม่ผ่าน ก็จะไม่เกิดอะไรขึ้นในส่วนนี้ครับ</p>
<p>ขอบคุณ<br />
<a href="http://msdotnetsupport.blogspot.com/2008/09/onclientclick-and-form-validation-in.html" target="_blank">msdotnetsupport</a><br />
<a href="http://www.stevekinsey.com/2007/06/04/onclientclick-and-form-validation-controls/" target="_blank">stevekinsey</a></p>
<p><span style="color: #800000;"><strong>หวังว่าข้อมูลนี้จะเป็นประโยชน์ไม่มากก็น้อยนะครับ</strong></span></p>
<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.aspgod.com/aspnet/onclientclick-with-validation-in-asp-net.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>javascript escape() encode url ภาษาไทย</title>
		<link>http://www.aspgod.com/aspnet/javascript-escape-encode-url-%e0%b8%a0%e0%b8%b2%e0%b8%a9%e0%b8%b2%e0%b9%84%e0%b8%97%e0%b8%a2.html</link>
		<comments>http://www.aspgod.com/aspnet/javascript-escape-encode-url-%e0%b8%a0%e0%b8%b2%e0%b8%a9%e0%b8%b2%e0%b9%84%e0%b8%97%e0%b8%a2.html#comments</comments>
		<pubDate>Fri, 25 Dec 2009 09:01:14 +0000</pubDate>
		<dc:creator>aspgod</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[encode]]></category>

		<guid isPermaLink="false">http://www.aspgod.com/?p=399</guid>
		<description><![CDATA[นานๆจะได้ลองเล่น Ajax ดู ก็เลยเกิดปัญหาที่ต้องส่งข้อมูลจาก javascript ไปยัง page อื่นเพื่อประมวลผล จริงๆจะไม่ใช้ Ajax ก็ได้ครับ แต่อารมณ์นั้นมันอยากลองของน่ะ เอาวิธีการใช้งาน Ajax จาก inoomzaa มาเล่นดูอ่ะ คือมันก็ใช้งานได้ดีกว่า .net 2.0 แต่มามีปัญหากับ .net 1.1 คงเพราะเป็น default encoding แหละครับ แก้ไปทุกกระบวนท่าใน page ขารับแล้วก็ไม่ได้ซักครั้ง จึงต้องใช้ท่าไม้ตาย เดินไปถามหัวหน้า(พี่ตู้) จึงได้คำตอบมาว่าให้ใส่ escape() ครอบข้อมูลในขาส่งไปยัง page ด้วย เพื่อ encode ก่อน เพราะภาษาไทยมีปัญหาเรื่องนี้ตลอดเลย ใช่ว่าจะหาคำตอบได้ง่ายๆ คนไทยเวลาพบปัญหาก็ไม่โพสวิธีการแก้ปัญหา พอไปหาเว็บนอก มันก็ไม่เจอปัญหาแบบที่คนไทยเจออีก เพราะของเค้าเป็นภาษาอังกฤษ ลองดูตัวอย่างโค๊ดนะครับ 1 2 // นี่เป็น javascript ในขาส่งครับ xmlHttp.open&#40;&#34;get&#34;,&#34;http://localhost/WEB/UtilPage/ResponseManualMsg.aspx?msg=&#34;+escape&#40;Criteria.value&#41;,true&#41;; // [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>นานๆจะได้ลองเล่น Ajax ดู ก็เลยเกิดปัญหาที่ต้องส่งข้อมูลจาก javascript ไปยัง page อื่นเพื่อประมวลผล จริงๆจะไม่ใช้ Ajax ก็ได้ครับ แต่อารมณ์นั้นมันอยากลองของน่ะ เอาวิธีการใช้งาน Ajax จาก <a href="http://krucode.net">inoomzaa</a> มาเล่นดูอ่ะ คือมันก็ใช้งานได้ดีกว่า .net 2.0 แต่มามีปัญหากับ .net 1.1 คงเพราะเป็น default encoding แหละครับ แก้ไปทุกกระบวนท่าใน page ขารับแล้วก็ไม่ได้ซักครั้ง จึงต้องใช้ท่าไม้ตาย เดินไปถามหัวหน้า(พี่ตู้) จึงได้คำตอบมาว่าให้ใส่ escape() ครอบข้อมูลในขาส่งไปยัง page ด้วย เพื่อ encode ก่อน เพราะภาษาไทยมีปัญหาเรื่องนี้ตลอดเลย ใช่ว่าจะหาคำตอบได้ง่ายๆ คนไทยเวลาพบปัญหาก็ไม่โพสวิธีการแก้ปัญหา พอไปหาเว็บนอก มันก็ไม่เจอปัญหาแบบที่คนไทยเจออีก เพราะของเค้าเป็นภาษาอังกฤษ ลองดูตัวอย่างโค๊ดนะครับ</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #008080; font-style: italic;">// นี่เป็น javascript ในขาส่งครับ</span>
xmlHttp<span style="color: #008000;">.</span><span style="color: #0000FF;">open</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;get&quot;</span>,<span style="color: #666666;">&quot;http://localhost/WEB/UtilPage/ResponseManualMsg.aspx?msg=&quot;</span><span style="color: #008000;">+</span>escape<span style="color: #008000;">&#40;</span>Criteria<span style="color: #008000;">.</span><span style="color: #0000FF;">value</span><span style="color: #008000;">&#41;</span>,<span style="color: #0600FF; font-weight: bold;">true</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span> <span style="color: #008080; font-style: italic;">// ใช้ escape เข้าช่วย</span></pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #008080; font-style: italic;">// ส่วนนี่เป็นหน้า .aspx ในขารับ ธรรมดามากมาย</span>
Response<span style="color: #008000;">.</span><span style="color: #0000FF;">Write</span><span style="color: #008000;">&#40;</span>Request<span style="color: #008000;">&#91;</span><span style="color: #666666;">&quot;msg&quot;</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span> <span style="color: #008080; font-style: italic;">// ไม่ต้องแปลงอะไรเลย</span></pre></td></tr></table></div>

<p>เสร็จสมบูรณ์อย่างสวยงาม เสียเวลาไปตั้ง 2 วันแน่ะ ไว้วันหลังจะหาวิธีการใช้ ajax ที่ดีกว่านี้มาให้ดูนะครับ</p>
<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.aspgod.com/aspnet/javascript-escape-encode-url-%e0%b8%a0%e0%b8%b2%e0%b8%a9%e0%b8%b2%e0%b9%84%e0%b8%97%e0%b8%a2.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

