<?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/"
	>

<channel>
	<title>:: Developer Zone ::</title>
	<atom:link href="http://devzonedd.homeip.net/index.php?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://devzonedd.homeip.net</link>
	<description>Web Developer ,Program ,asp.net,php,ajax,javascript,design</description>
	<pubDate>Mon, 21 Sep 2009 13:42:10 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>ค้นหาเส้นทาง กับ Google Map แบบง่ายๆ ผ่านหน้าเว็บตัวเอง</title>
		<link>http://devzonedd.homeip.net/?p=182</link>
		<comments>http://devzonedd.homeip.net/?p=182#comments</comments>
		<pubDate>Tue, 09 Jun 2009 05:19:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Web application Develop]]></category>

		<guid isPermaLink="false">http://devzonedd.homeip.net/?p=182</guid>
		<description><![CDATA[ในบทความนี้ จุดเริ่มต้นอยู่ที่ว่า ผมจะทำเว็บ www.thaieasy2home.com ตัวใหม่ ปี 2009 (จะทำตั้งแต่ปลายปีที่แล้ว ไม่ได้ทำซะที) โดยจะเพิ่มส่วน google map เข้าไป และ ส่วนค้นหาเส้นทาง กับ google map โดยใช้ API ของ google map เอง
ซึ่งการ เพิ่ม Maker ในแผนที่ และแสดงMaker บนแผนที่นั้น เป็นเรื่องปกติของทุกเว็บที่ทำกัน แต่การจะทำส่วน ที่เอื้อประโยชน์ ให้กับคนที่จะค้นหาบ้าน ที่ลงประกาศขาย นั้นว่าจะเดินทาง จุดไหน ไปยังบ้านที่ประกาศขาย ต้องเดินทางไปอย่างไร เส้นทางไหน นั้นยังไม่มีเว็บไหนเค้าทำกัน

ในที่นี้ผมก็ ตั้งใจไว้ว่าจะทำส่วนนี้เพิ่มเข้ามาเพื่อเป็นจุดต่างกับเว็บอื่นๆ แต่เนื่องจาก google Map API นั้นไม่ได้รองรับส่วนการ ค้นหาเส้นทาง ดังนั้นจึงมีวิธีเดียว นั่นก็คือ การ hack google map นั่นเองครับ จาก [...]]]></description>
			<content:encoded><![CDATA[<h2>ในบทความนี้ จุดเริ่มต้นอยู่ที่ว่า ผมจะทำเว็บ www.thaieasy2home.com ตัวใหม่ ปี 2009 (จะทำตั้งแต่ปลายปีที่แล้ว ไม่ได้ทำซะที) โดยจะเพิ่มส่วน google map เข้าไป และ ส่วนค้นหาเส้นทาง กับ google map โดยใช้ API ของ google map เอง</h2>
<p>ซึ่งการ เพิ่ม Maker ในแผนที่ และแสดงMaker บนแผนที่นั้น เป็นเรื่องปกติของทุกเว็บที่ทำกัน แต่การจะทำส่วน ที่เอื้อประโยชน์ ให้กับคนที่จะค้นหาบ้าน ที่ลงประกาศขาย นั้นว่าจะเดินทาง จุดไหน ไปยังบ้านที่ประกาศขาย ต้องเดินทางไปอย่างไร เส้นทางไหน นั้นยังไม่มีเว็บไหนเค้าทำกัน<br />
<img src="http://devzonedd.homeip.net/images/map.jpg" border="0" alt="" /></p>
<p>ในที่นี้ผมก็ ตั้งใจไว้ว่าจะทำส่วนนี้เพิ่มเข้ามาเพื่อเป็นจุดต่างกับเว็บอื่นๆ แต่เนื่องจาก google Map API นั้นไม่ได้รองรับส่วนการ ค้นหาเส้นทาง ดังนั้นจึงมีวิธีเดียว นั่นก็คือ การ hack google map นั่นเองครับ จาก URL http://map.google.com<br />
<span id="more-182"></span><br />
ซึ่งสามารถทำได้ง่ายๆ เพราะ google map ได้ออกแบบ ระบบไว้ เพื่อให้สามารถรับ คำสั่งผ่าน query String ได้อยู่แล้ว เหมือนกับ หน้าเว็บ google หลัก<br />
ลองมาดูตัวอย่างกัน จาก url ด้านล่างนี้ที่ จุดเริ่มต้นคือ อ่อนนุช จะเดินทางไปรังสิต ต้องไปอย่างไร นะครับ</p>
<p>http://maps.google.com/maps?f=d&amp;ie=TIS-620&amp;z=9&amp;hl=th&amp;mra=ls&amp;dirflg=h&amp;source=s_d&amp;saddr=อ่อนนุช,+thailand&amp;daddr=รังสิต,+thailand&amp;sll=13.71633083827982&amp;sspn=100.65454959869385&amp;ll=14.019709621669195&amp;spn=100.73347091674804</p>
<p>จาก URL ด้านบน ผมจะอธิบาย QueryString ที่สำคัญสำหรับ การค้นหาเส้นทางดังนี้ครับ<br />
saddr=ชื่อสถานที่ต้นทาง<br />
daddr=ชื่อสถานที่ปลายทาง<br />
sll=ละติจูด ต้นทาง<br />
sspn=ลองติจูดต้นทาง<br />
ll=ละติจูด ปลายทาง<br />
spn=ลองติจูดปลายทาง<br />
z=การ zoom ซึ่ง จะสามารถใส่ตัวเลข ได้ตามใจ ตั้งแต่ 1-17</p>
<p>การหาตำแหน่งของ ละติจูด ต้นทางและปลายทางนั้น สามารถ ดึงมาได้จาก google map api ซึ่งผมจะขอไปเขียนใส่ไว้ในบทความ หน้านะครับ เพราะเห็นว่า มีคนเขียนไว้พอสมควรแล้ว</p>
]]></content:encoded>
			<wfw:commentRss>http://devzonedd.homeip.net/?feed=rss2&amp;p=182</wfw:commentRss>
		</item>
		<item>
		<title>การทำ Backup File server แบบง่ายๆ โดยใช้ Batch File</title>
		<link>http://devzonedd.homeip.net/?p=179</link>
		<comments>http://devzonedd.homeip.net/?p=179#comments</comments>
		<pubDate>Mon, 18 May 2009 10:55:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Windows Zone]]></category>

		<guid isPermaLink="false">http://devzonedd.homeip.net/?p=179</guid>
		<description><![CDATA[เริ่มต้นที่ปัญหา บริษัทผมมี เครื่อง File server ตัวนึง เอาไว้เป็น Drive กลางให้ฝ่ายต่างๆ ในบริษัท
จำเป็นต้องทำการ Backup Drive ที่แชร์ให้ฝ่ายต่างๆในบริษัทใช้ โดยที่จะต้อง ทำการ Backup ทุกวัน และบริษัทไม่ค่อยให้งบประมาณเท่าไหร่ในเรื่องนี้ ก็เลยต้องทำแบบ เบสิกสุดๆ โดยการ ใช้ backup window เนี่ยแหละทำ
&#8216; =================================
การทำงานของระบบ Backup ของผมนี้ คือ 1 ที่เครื่อง file server ให้ทำการ ตั้ง schedule Backup ของ window ในแต่ละ folder ออกมาเป็น ไฟล์ .bkf เช่น

ใน Drive D ของเครื่อง File server มี folder ต่างๆดังนี้
E:\-Account
      - Marketing
      [...]]]></description>
			<content:encoded><![CDATA[<p>เริ่มต้นที่ปัญหา บริษัทผมมี เครื่อง File server ตัวนึง เอาไว้เป็น Drive กลางให้ฝ่ายต่างๆ ในบริษัท<br />
จำเป็นต้องทำการ Backup Drive ที่แชร์ให้ฝ่ายต่างๆในบริษัทใช้ โดยที่จะต้อง ทำการ Backup ทุกวัน และบริษัทไม่ค่อยให้งบประมาณเท่าไหร่ในเรื่องนี้ ก็เลยต้องทำแบบ เบสิกสุดๆ โดยการ ใช้ backup window เนี่ยแหละทำ<br />
&#8216; =================================<br />
การทำงานของระบบ Backup ของผมนี้ คือ 1 ที่เครื่อง file server ให้ทำการ ตั้ง schedule Backup ของ window ในแต่ละ folder ออกมาเป็น ไฟล์ .bkf เช่น<br />
<span id="more-179"></span><br />
ใน Drive D ของเครื่อง File server มี folder ต่างๆดังนี้<br />
E:\-Account<br />
      - Marketing<br />
      - HR<br />
      - Sale<br />
      - IT</p>
<p>วิธีการของผมก็คือจะสร้าง Folder อีกตัวนึง ชื่อ DailyBackup ขึ้นมา ใน DailyBackup นี้ก็จะมี Folder ตามฝ่ายต่างๆ เพื่อที่ ผมจะให้ backup window นั้นสร้างไฟล์ bkf ไว้ใน folder เหล่านั้นนะครับ<br />
E:\DailyBackup<br />
            |- Account<br />
                   |-account.bkf<br />
            |- Marketing<br />
                   |-Marketing.bkf<br />
            |- HR<br />
                   |-HR.bkf<br />
            |- Sale<br />
                   |-Sale.bkf<br />
            |- IT<br />
                   |-IT.bkf<br />
<strong>หมายเหตุ</strong> ไฟล์ *.bkf จะเป็นไฟล์ใหม่ในแต่ละวัน ส่วนวิธีการ backup หาอ่านได้ที่นี่ http://www.justusers.net/articles/ossystem/xpbackup/backup.htm<br />
&#8216; =================================<br />
เมื่อตั้งข้อมูลเบื้องต้นเสร็จเรียบร้อยแล้วทีนี้ก็เป็น กระบวนการ จับ zip ไฟล์ *.bkf เพื่อบีบอัดข้อมูล ได้มากมายครับ<br />
ผมจึงได้ทำการเขียน batch file ขึ้นมาตัวนึง โคดดังนี้ครับ<br />
&#8216; ========= ScriptDaily.bat =========<br />
@echo off<br />
for /f &#8220;tokens=1-4 delims=/ &#8221; %%i in (&#8221;%date%&#8221;) do (<br />
set dow=%%i<br />
set month=%%j<br />
set day=%%k<br />
set year=%%l<br />
)<br />
SET d=%year%%month%%day%<br />
SET Source=E:\<br />
SET Des=E:\DailyBackup\<br />
REM ใส่ Log ซะหน่อยครับ เพื่อดูผลของการกระทำ สร้าง folder !LogBackup ขึ้นมา เพื่อเก็บไฟล์ Log<br />
SET LOGPATH=E:\!LogBackup<br />
echo Start Schedule Command Rar File backup as of %d% &gt; %LOGPATH%\B_%d%.txt<br />
echo ======================================================== &gt;&gt; %LOGPATH%\B_%d%.txt</p>
<p>for %%i in (Account Marketing HR Sale IT) DO (<br />
   call commandRar.bat <strong>%Source%\%%i\%%i.bkf</strong> <strong>%Des%\%%i\%d%.rar</strong><br />
)<br />
echo ===================================================&gt;&gt; %LOGPATH%\B_%d%.txt<br />
echo ScriptDaily Backup Success!! at %date% %time% &gt;&gt; %LOGPATH%\B_%d%.txt<br />
exit<br />
&#8216; ======== จบ ScriptDaily.bat ============</p>
<p>จากโคดจะเห็นว่า มีการ วน loop ตาม folder ต่างๆ ที่กำหนดไว้ใน for<br />
และ มีการเรียกใช้ batch อีกตัวเพื่อทำการ zip ในที่นี้ผมใช้ winrar เนื่องจาก สามารถ zip ได้ในขนาดใหญ่ๆได้ และบีบอัดได้ดีกว่า</p>
<p>&#8216; ======== commandRar.bat =============<br />
@echo off</p>
<p>REM WinRAR - - &lt;@listfiles&#8230;&gt;<br />
REM set path WinRar ใน environment ของ window ก่อน<br />
set path=&#8221;C:\Program Files\WinRAR\&#8221;;%path%</p>
<p>         WinRAR a -r %2 %1<br />
echo commandRar %1<br />
echo in to<br />
echo %2 Success!!<br />
echo ========================================================<br />
REM when zip backup file finish. and then delete original file backup<br />
del %1<br />
&#8216; ======== จบ commandRar.bat =============</p>
<p>เสร็จสิ้นเรียบร้อยแล้ว<br />
<strong>หมายเหตุสำหรับคนไม่ชำนาญ</strong><br />
- การเขียน Log File ใน batch file ทำได้ง่ายโดยการ ใช้คำสั่ง echo ข้อมูลออกมาแล้ว จะเอาไปเก็บในไฟล์ไหน ก็เพียงแค่ใช้เครื่องหมาย &gt; ชื่อไฟล์ ดังเช่น<br />
<strong>echo Test Create Logfile &gt; C:\testLog.txt</strong>ก็จะเป็นการสร้าง text file ชื่อ testLog.txt ในไดร์ C ครับ ซึ่งมีข้อความว่า Test Create Logfile<br />
หากต้องการ สร้าง ข้อความต่อ ก็เพียงแค่ ใส่เครื่อง <strong>&gt;</strong> เป็น 2 ตัวนะครับเช่น<br />
<strong>echo Test Create Logfile Line2 &gt;&gt; C:\testLog.txt</strong>หลังจากบรรทัดนี้ ไฟล์ testLog.txt จะมี 2 บรรทัด บรรทัดที่ 2 จะชื่อ Test Create Logfile Line2</p>
<p>- การเรียกใช้งาน BatchFile อีกตัว ทำการเรียกได้โดยใช้คำสั่ง Call ที่อยู่ batchfile<br />
   เช่น call commandRar.bat</p>
<p>- การ ส่ง parameter ให้ BatchFile อีกตัวนึง ทำได้โดย การใส่ข้อมูลตามหลัง BatchFile โดยการเว้นวรรค 1 ครั้ง และ ใส่ parameter ตัวที่ 2 ต่อไปได้โดยใช้ เว้นวรรค เป็นตัวคั่นระหว่าง parameter ครับ<br />
   call commandRar.bat parameter1 parameter2 parameter3<br />
และในไฟล์ commandRar ที่มีการอ้างถึง เราสามารถ อ้างถึง parameter แต่ละตัวได้โดย ใช้ % ตามด้วย parameter ครับ จาก บรรทัดด้านบนนี้ โคดใน commandRar.bat เราสามารถอ้างถึง parameter ต่างๆได้โดย<br />
echo %1    &lt;&#8212; จะได้ค่า parameter1<br />
echo %2   &lt;&#8212; จะได้ค่า parameter2<br />
echo %3  &lt;&#8212; จะได้ค่า parameter3</p>
<p>ก็เป็นอันจบเบื้องต้นนะครับ</p>
]]></content:encoded>
			<wfw:commentRss>http://devzonedd.homeip.net/?feed=rss2&amp;p=179</wfw:commentRss>
		</item>
		<item>
		<title>Outlook will not show embedded Picture</title>
		<link>http://devzonedd.homeip.net/?p=177</link>
		<comments>http://devzonedd.homeip.net/?p=177#comments</comments>
		<pubDate>Fri, 03 Apr 2009 03:38:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Windows Zone]]></category>

		<guid isPermaLink="false">http://devzonedd.homeip.net/?p=177</guid>
		<description><![CDATA[ปัญหานี่เริ่มจาก มีการใช้ screen shot แล้วไป past ลงใน ช่อง message ของ outlook ซึ่งโดยปกติ ก็จะเป็นการ ทำ embedded picture ให้ message นั้นแสดงรูปภาพ ทันทีนะครับ
แต่มาวันนึง เครื่องผมเป็นไรไม่รู้ ภาพทั้งหมด กลับไม่แสดงเลย ส่วนที่เป็นภาพ ก็เป็นเหมือน Link ผิด ทำให้บริเวณภาพ เป็น [x] ด้วยความที่ไม่รู้ ผมก้อทำการ แก้ไข config ทั้งหมด นึกว่า เกี่ยวกับ download picture ก็ไปตั้งค่าใหม่ก็แล้ว เปลี่ยน HTML ก็แล้ว ภาพก็ไม่แสดงซักที search หาข้อมูลใน Internet ก็ยังไม่ได้คำตอบ
จนหมดปัญญา ลอง Uninstall Microsoft Office ออกไปจากเครื่องเลย แล้ว Install [...]]]></description>
			<content:encoded><![CDATA[<p>ปัญหานี่เริ่มจาก มีการใช้ screen shot แล้วไป past ลงใน ช่อง message ของ outlook ซึ่งโดยปกติ ก็จะเป็นการ ทำ embedded picture ให้ message นั้นแสดงรูปภาพ ทันทีนะครับ</p>
<p>แต่มาวันนึง เครื่องผมเป็นไรไม่รู้ ภาพทั้งหมด กลับไม่แสดงเลย ส่วนที่เป็นภาพ ก็เป็นเหมือน Link ผิด ทำให้บริเวณภาพ เป็น [x] ด้วยความที่ไม่รู้ ผมก้อทำการ แก้ไข config ทั้งหมด นึกว่า เกี่ยวกับ download picture ก็ไปตั้งค่าใหม่ก็แล้ว เปลี่ยน HTML ก็แล้ว ภาพก็ไม่แสดงซักที search หาข้อมูลใน Internet ก็ยังไม่ได้คำตอบ<br />
จนหมดปัญญา ลอง Uninstall Microsoft Office ออกไปจากเครื่องเลย แล้ว Install ใหม่ ผลก็ยังไม่หาย ตอนนั้นคิดว่ามีทางเดียวคือ คงต้อง Format เครื่องทิ้งซะละม้างงง<br />
<span id="more-177"></span><br />
แต่ด้วยความขี้เกียจ ก็จึงได้พยายามลอง นึกทบทวนอีกครั้งว่ามันน่าจะเกิดจากสาเหตุใด ก็เลยนึกขึ้นได้ว่า ทั้งภาพ และไฟล์ที่แสดงใน outlook นั้นมันจะต้องไปเก็บไว้ใน Temp Folder เพื่อแสดงผลก่อนนั่นเอง อาจเป็นไปได้ว่า ข้อมูลใน tem folder เต็ม ผมก้อเลย ลองลบ Temporary Internet Files ซึ่งโดยปกติ จะอยู่ใน C:\Documents and Settings\username\Local Settings\Temporary Internet Files<br />
ลองลบไปก็ยังไม่หาย แสดงว่าภาพที่ outlook เก็บมันไม่ได้อยู่ใน Temporary Internet Files แล้วมันอยู่ไหน(วะ) ก็เลยบุกเข้าไปดูใน Registry ที่ HKEY_CURRENT_USER\Software\Microsoft\Office\11\Outlook\Security  จึงเห็นว่า มันอยู่ใน Temporary Internet Files นั่นแหละครับ แต่ดันอยู่ใน folder OLKAB อีกที (Folder Temporary Internet File และ OLKAB มันมองไม่เห็นนะครับต้อง พิมพ์ path เข้าไปตรงๆ เนื่องจาก ใน folder options ที่ view มีการติ๊ก Hide protectred operating system files ไว้สำหรับ window เป็นค่า default ครับ จึงซ่อนไฟล์ system ไว้ไม่ให้ user เห็น จะเอาออกก็ได้นะครับ)<br />
จึงเห็นว่า มีไฟล์ จากอดีตกาล มหาศาลมาก ไม่เคยลบมันทิ้งเลย ผมก็เลยลองลบทิ้งดูทั้งหมด แล้วกลับมาดูที่ outlook อีกที ปรากฏว่า หายครับ ภาพแสดงได้ตามปกติ ด้วยความไม่รู้ เกือบซวย เกือบได้ format เครื่องใหม่ซะแล้ว เพียงแค่ temp มันเต็มเท่านั้น</p>
]]></content:encoded>
			<wfw:commentRss>http://devzonedd.homeip.net/?feed=rss2&amp;p=177</wfw:commentRss>
		</item>
		<item>
		<title>การใช้ Query copy table และ การ insert from query selection</title>
		<link>http://devzonedd.homeip.net/?p=175</link>
		<comments>http://devzonedd.homeip.net/?p=175#comments</comments>
		<pubDate>Mon, 23 Mar 2009 02:13:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Database]]></category>

		<guid isPermaLink="false">http://devzonedd.homeip.net/?p=175</guid>
		<description><![CDATA[ในบทความนี้จะเป็นการใช้งานคำสั่ง Insert ในรูปแบบย่อยๆ อีกรูปแบบหนึ่งนะครับ ซึ่งเป็นเกร็ดเล็กๆน้อยๆ แต่สามารถนำไปประยุกต์ใช้งานได้อย่างดีเยี่ยม
1. การใช้งานคำสั่ง Query Insert copy table การสร้าง คำสั่งนี้เราจะใช้บ่อยในกรณี การทำ temp table เพื่อออกรายงาน เนื่องจาก การออกรายงาน อาจจะต้องทำสรุปผลข้อมูล จากหลายๆ table มาประมวลผลเพื่อให้ได้ข้อมูลสุดท้าย แล้วเก็บไว้ใน temp table เพื่อให้หน้ารายการเรียกข้อมูล สรุปผลมาแสดงทั้งนี้เพื่อความรวดเร็วในการแสดงผลข้อมูลนั่นเอง คำสั่ง copy table นั้นเหมาะกับกรณีที่เราต้องการสร้าง temp table แรก หรือ summary table แรกขึ้นมา ทั้งจำนวน field และ ชนิดข้อมูล เราไม่จำเป็นจะต้อง ไปสร้าง table เปล่าๆ แล้ว ค่อยๆใส่ fields ตามที่เราต้องการ เนื่องจากมันอาจจะมีปริมาณค่อนข้างมาก จึงใช้คำสั่งนี้ สร้างขึ้นมาครั้งแรกนั่นเอง

รูปแบบการใช้งานคำสั่ง copy [...]]]></description>
			<content:encoded><![CDATA[<p>ในบทความนี้จะเป็นการใช้งานคำสั่ง Insert ในรูปแบบย่อยๆ อีกรูปแบบหนึ่งนะครับ ซึ่งเป็นเกร็ดเล็กๆน้อยๆ แต่สามารถนำไปประยุกต์ใช้งานได้อย่างดีเยี่ยม</p>
<p>1. การใช้งานคำสั่ง Query Insert copy table การสร้าง คำสั่งนี้เราจะใช้บ่อยในกรณี การทำ temp table เพื่อออกรายงาน เนื่องจาก การออกรายงาน อาจจะต้องทำสรุปผลข้อมูล จากหลายๆ table มาประมวลผลเพื่อให้ได้ข้อมูลสุดท้าย แล้วเก็บไว้ใน temp table เพื่อให้หน้ารายการเรียกข้อมูล สรุปผลมาแสดงทั้งนี้เพื่อความรวดเร็วในการแสดงผลข้อมูลนั่นเอง คำสั่ง copy table นั้นเหมาะกับกรณีที่เราต้องการสร้าง temp table แรก หรือ summary table แรกขึ้นมา ทั้งจำนวน field และ ชนิดข้อมูล เราไม่จำเป็นจะต้อง ไปสร้าง table เปล่าๆ แล้ว ค่อยๆใส่ fields ตามที่เราต้องการ เนื่องจากมันอาจจะมีปริมาณค่อนข้างมาก จึงใช้คำสั่งนี้ สร้างขึ้นมาครั้งแรกนั่นเอง</p>
<p><span id="more-175"></span><br />
<strong>รูปแบบการใช้งานคำสั่ง copy table</strong><br />
SELECT * INTO [ชื่อ table ใหม่]<br />
 from [table ที่นำมาแสดง]</p>
<p>2. การ insert from query selection ในรูปแบบการ insert นี้ ก็เหมือนกับการ insert ธรรมดา เพียงแต่ สามารถ insert ได้หลายๆ record ตามแต่ที่จะ selection ขึ้นมานั่นเอง โดยปกติ การ insert 1 คำสั่ง จะเป็นการ insert 1 record หากต้องการ insert ครั้งละ หลายๆ record ก็ต้องการ insert from selection นะครับ ซึ่งในรูปแบบนี้ เราจะใช้งาน ในการนำข้อมูลเพื่อไปใส่ใน temp table หรือ summary table</p>
<p>รูปแบบการใช้งานคำสั่ง insert from selection<br />
 insert into  [ชื่อ table] select * from [table ที่จะ นำไปใส่]</p>
<p>โดยปกติ เวลา update summary หรือ temp table นั้น จะสร้างเป้น store procedure ขึ้นมา เพื่อเรียก update ข้อมูลนะครับเช่น<br />
Create Proc sp_updateTable<br />
as<br />
&#8211; ลบข้อมูลเก่าออกก่อน<br />
 delete from [ชื่อ table] <br />
&#8211; แล้ว insert ข้อมูลใหม่ลงไป<br />
 insert into  [ชื่อ table] select * from [table ที่จะ นำไปใส่]</p>
<p>ทั้งนี้ ข้อมูลที่จะ select เพื่อนำไปใส่ จะต้อง แสดง fields ให้เท่ากันด้วย</p>
]]></content:encoded>
			<wfw:commentRss>http://devzonedd.homeip.net/?feed=rss2&amp;p=175</wfw:commentRss>
		</item>
		<item>
		<title>SQL Server Replication</title>
		<link>http://devzonedd.homeip.net/?p=172</link>
		<comments>http://devzonedd.homeip.net/?p=172#comments</comments>
		<pubDate>Wed, 18 Mar 2009 04:21:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Database]]></category>

		<guid isPermaLink="false">http://devzonedd.homeip.net/?p=172</guid>
		<description><![CDATA[ในบทความนี้ ปัญหาเริ่มจากการที่เรามี ฐานข้อมูล 2 ที่ ซึ่งเราจำเป็นต้อง ให้ข้อมูลในฐานข้อมูลทั้ง 2 นี้ update หากันตลอดเวลา เราจะทำได้อย่างไร
ลองนึกตัวอย่าง หากสมมุติว่าเรามีฐานข้อมูลในเครื่องของตัวเอง ไว้เพื่อทดสอบ และ เรามี ฐานข้อมูลที่อยู่บน Hosting สำหรับใช้งานจริง แล้ว ถ้าเราจะเอาข้อมูลจาก host backup เพื่อมา restore ในเครื่องทดสอบของเรา เองนั้นก็เป็นสิ่งที่ไม่ยากใช่มั้ยครับ
แต่หากว่า เราต้อง backup และ restore ทุกวัน หรือวันละ หลายๆครั้งเราจะทำยังไง ให้นั่งทำตลอดเวลา มันไม่ใช่เรื่องเล่นๆแน่ ทั้งวันคงไม่ต้องทำอย่างอื่นแล้ว ดังนั้นจึงจำเป็นที่จะต้องมีเทคโนโลยีที่เป็นตัวช่วยสำหรับเหตุการอย่างนี้ ขึ้นมา หรือก็คือการทำ Replication นั่นเอง เพื่อให้ข้อมูล จากที่หนึ่ง วิ่งไป หาข้อมูลอีกที่หนึ่ง แบบอัตโนมัติ
สำหรับในบทความนี้ ผมได้นำมาจาก เว็บไซต์ http://coresharp.net/blogs/article/archive/2008/01/01/sql-server-replication-pocket-pc-1.aspx ที่เขียนข้อมูลไว้ได้ มากครับ
สิ่งที่อยากจะเสริมก็คือเรื่องราวเกี่ยวกับ SQL Server CE ซึ่งจะถูกใช้เป็นโปรแกรมบริหารฐานข้อมูลสำหรับแอพพลิเคชัน [...]]]></description>
			<content:encoded><![CDATA[<p>ในบทความนี้ ปัญหาเริ่มจากการที่เรามี ฐานข้อมูล 2 ที่ ซึ่งเราจำเป็นต้อง ให้ข้อมูลในฐานข้อมูลทั้ง 2 นี้ update หากันตลอดเวลา เราจะทำได้อย่างไร</p>
<p>ลองนึกตัวอย่าง หากสมมุติว่าเรามีฐานข้อมูลในเครื่องของตัวเอง ไว้เพื่อทดสอบ และ เรามี ฐานข้อมูลที่อยู่บน Hosting สำหรับใช้งานจริง แล้ว ถ้าเราจะเอาข้อมูลจาก host backup เพื่อมา restore ในเครื่องทดสอบของเรา เองนั้นก็เป็นสิ่งที่ไม่ยากใช่มั้ยครับ</p>
<p>แต่หากว่า เราต้อง backup และ restore ทุกวัน หรือวันละ หลายๆครั้งเราจะทำยังไง ให้นั่งทำตลอดเวลา มันไม่ใช่เรื่องเล่นๆแน่ ทั้งวันคงไม่ต้องทำอย่างอื่นแล้ว ดังนั้นจึงจำเป็นที่จะต้องมีเทคโนโลยีที่เป็นตัวช่วยสำหรับเหตุการอย่างนี้ ขึ้นมา หรือก็คือการทำ Replication นั่นเอง เพื่อให้ข้อมูล จากที่หนึ่ง วิ่งไป หาข้อมูลอีกที่หนึ่ง แบบอัตโนมัติ</p>
<p><span id="more-172"></span>สำหรับในบทความนี้ ผมได้นำมาจาก เว็บไซต์ <a href="http://coresharp.net/blogs/article/archive/2008/01/01/sql-server-replication-pocket-pc-1.aspx">http://coresharp.net/blogs/article/archive/2008/01/01/sql-server-replication-pocket-pc-1.aspx</a> ที่เขียนข้อมูลไว้ได้ มากครับ</p>
<p>สิ่งที่อยากจะเสริมก็คือเรื่องราวเกี่ยวกับ SQL Server CE ซึ่งจะถูกใช้เป็นโปรแกรมบริหารฐานข้อมูลสำหรับแอพพลิเคชัน .NET ที่ทำงานบน Pocket PC พวกคุณผู้อ่านบางคนคงจะรู้ว่า SQL Server นั้นบันทึกข้อมูลของฐานข้อมูลเป็นไฟล์ ถ้าเป็นเวอร์ชันพี่เบิ้มหน่อยอย่าง Enterprise หรือ Developer นั้นก็จะเป็นไฟล์ที่มีนามสกุล mdf (หรือ ndf) และถ้าเป็นเวอร์ชัน CE (ขอเรียกสั้นๆหน่อยนะครับ) ก็จะเป็นไฟล์นามสกุล sdf ทีนี้เจ้าไฟล์ sdf ตัวนี้จะรับข้อมูลเริ่มต้นมาจากฐานข้อมูลศูนย์กลาง แล้วมันก็จะถูกใช้งานเฉพาะตัวสำหรับสมาร์ทดีไวส์หนึ่งๆเท่านั้นเอง และเมื่อถึงระยะเวลาหนึ่งมันก็จะต้องทำการซิงโครไนส์กับฐานข้อมูลศูนย์กลาง เพื่อนำรายละเอียดการเปลี่ยนแปลงที่มันบันทึกไว้ไปบันทึกและดึงข้อมูลจากฐานข้อมูลศูนย์กลางมาอัพเดพข้อมูลของมัน การซิงโครไนส์ดังกล่าวมีวิธีให้เลือกทำได้ 2 วิธีคือ RDA (Remote Data Access) หรือไม่ก็ Merge Replication โดยหลายตำรารวมถึงแหล่งข้อมูลความรู้ส่วนใหญ่จะแนะนำให้ใช้วิธี Merge Replication เหตุผลหลักก็คือความสามารถที่สูงส่งกว่านั่นเอง</p>
<p>ถ้ากล่าวโดยรวมๆแล้ว Replication นั้นได้รับการกล่าวขานจากนักวิจารณ์, DBA, Consultant จำนวนมากว่าเป็นฟีเจอร์ที่ดีที่สุดและน่าชื่นชมที่สุดฟีเจอร์หนึ่งเลยทีเดียว งานที่ต้องดำเนินการแบบกระจาย (Distributed Transaction) สามารถดำเนินไปด้วยประสิทธิภาพที่ดีเมื่อเลือกใช้ Replication เป็นโซลูชัน งานดังกล่าวจะรวมถึง</p>
<ul>
<li>การกระจายและรวบรวมข้อมูลจากสำนักงาน(หรือสาขา)ที่กระจายอยู่ในหลายภูมิภาค</li>
<li>แอพพลิเคชันแบบ Scaling Out</li>
<li>การเตรียมข้อมูลสำเนาให้ใช้ในการออกรายงานหรืองานที่ไม่มีการเปลี่ยนแปลงข้อมูล</li>
<li>การทำ Data Warehouse</li>
</ul>
<p>คำจำกัดความอย่างสั้นๆของ Replication คือการทำสำเนาข้อมูลซึ่งอาจจะเล็กแค่หนึ่งเทเบิลหรือใหญ่ถึงขนาดมีข้อมูลครบทั้งฐานข้อมูล แล้วกระจายออกไปใช้งานในแหล่งอื่นๆที่มีความสัมพันธ์กัน และยังสามารถกำหนดให้นำข้อมูลที่มีการเปลี่ยนแปลงจากแหล่งใดๆ (ที่ได้รับการกระจายข้อมูลให้ในตอนแรก) กลับมาอัพเดตให้กับแหล่งอื่นๆที่เกี่ยวข้องกันด้วย</p>
<p>สิ่งที่ควรพูดถึงต่อไปเกี่ยวกับ Replication ก็คือองค์ประกอบหลัก ซึ่งเกิดขึ้นและทำงานร่วมกันหลังจากการกำหนดค่าใน SQL Server ขึ้นมาแล้ว ไมโครซอฟท์อุปมาอุปมัยงาน Replication เหมือนเป็นธุรกิจสิ่งพิมพ์ (นิตยสาร, วารสาร) ซึ่งองค์ประกอบที่สำคัญคือ</p>
<ul>
<li><strong>Publisher</strong> เป็นเซิร์ฟเวอร์ที่ให้กำเนิดข้อมูลที่จะส่งกระจายออกไปนั่นเอง ข้อมูลที่เตรียมไว้และจะส่งกระจายออกไปแต่ละครั้งนั้นจะเรียกว่า Publications (สิ่งตีพิมพ์) ซึ่งประกอบขึ้นมาจาก Articles (บทความ) โดยแต่ละ Article ก็จะเป็นลอจิคัลเทเบิล ขึ้นอยู่กับการกำหนดค่าของ Replication เองว่า Article หนึ่งๆอาจจะเป็นหนึ่งเทเบิลหรือหนึ่งวิวเลยก็ได้ (เทเบิล&lt;table&gt; และวิว&lt;view&gt; นั้นคาดว่าผู้อ่านส่วนใหญ่น่าจะแยกแยะและเข้าใจความหมายได้ดี) หรืออาจจะเป็นกลุ่มของคอลัมน์จากเทเบิล/วิวใดๆ โดยไม่ได้ดึงมาครบทั้งเทเบิล/วิวก็ได้</li>
<li><strong>Subscriber</strong> เป็นเซิร์ฟเวอร์ที่คอยรับ Publications (หรือไปดึงเอามา) ที่ Publisher ผลิตออกมา ก่อนจะรับหรือไปดึงมา ต้องจัดการเรื่อง Subscription (การสมัคร) ให้เรียบร้อยก่อนซึ่งมีอยู่ 2 แบบได้แก่<br />
<strong><em>Pull Subsciption</em></strong> เป็นการสมัครเพื่อที่ Subscriber จะได้ไปดึงข้อมูล Publications มาใช้งานได้ หรือกล่าวได้ว่าเป็นการทำงานหรือความรับผิดชอบของเซิร์ฟเวอร์ที่เป็น Subscriber เองในการไปรับข้อมูล Publications มา เหมาะกับเซิร์ฟเวอร์ที่ไม่ได้เชื่อมต่อกับเซิร์ฟเวอร์ที่เป็น Publisher อย่างสม่ำเสมอ<br />
<strong><em>Push Subscription</em></strong> เป็นการสมัครเพื่อที่เซิร์ฟเวอร์ที่เป็น Publishers จะเป็นฝ่ายดำเนินการส่งข้อมูลออกมาให้เซิร์ฟเวอร์ที่เป็น Subscribers เอง การทำงาน(รวมไปถึงการใช้ทรัพยากรระบบ) จะเกิดขึ้นที่ Distributors</li>
<li><strong>Distributor</strong> เป็นเซิร์ฟเวอร์ที่ทำหน้าที่รวบรวม Publications จาก Publishers (หลาย Publishers สามารถใช้งาน Distributor เดียวกันร่วมกันได้) ก่อนจะส่งต่อออกไปที่ Subscribers (หรือ Subscribers มาดึงเอาไป) ถ้าเป็น Replication ที่กำหนดค่าอย่างง่ายแล้ว Publisher กับ Distributor สามารถถูกกำหนดให้ทำงานอยู่บนเซิร์ฟเวอร์เดียวกันก็ได้ (ถ้ากล่าวในมุมมองของ SQL Server อาจกล่าวได้ว่าถูกกำหนดให้ทำงานอยู่ในอินสแตนส์ (Instance) เดียวกัน) ข้อมูล Publications จะถูกเก็บรวบรวมไว้ที่ฐานข้อมูลระบบชื่อ Distribution ซึ่งหากยังไม่มีการกำหนดให้เกิดงาน Replication ขึ้นก็จะไม่มีฐานข้อมูลนี้ปรากฏขึ้นมาที่เซิร์ฟเวอร์ที่เป็น Distributor</li>
</ul>
<p> </p>
<p><a><img src="http://coresharp.net/images/ReplicationPocketPC1_14740/Replication01_01_thumb3_thumb.png" alt="" width="360" height="480" /></a></p>
<p> </p>
<p>เมื่อรู้จักองค์ประกอบเรียบร้อยแล้ว ก่อนจะจบบทความตอนนี้ไป ขอโปรยไว้นิดนึงก่อนว่า Replication ใน SQL Server นั้นมีอยู่ด้วยกัน 3 ชนิด ได้แก่</p>
<ol>
<li>Snapshot Replication</li>
<li>Transactional Replication</li>
<li>Merge Replication</li>
</ol>
<p>รายละเอียดนั้นจะมาบรรยายในบทความหัวเดียวกันนี้ในตอนต่อไป ติดตามกันต่อนะครับ ขอให้ทุกท่านประสบแต่สิ่งดี</p>
<p>**********************</p>
<p>การประมวลผล distributed transactions ร่วมกับ DTC นั้นทุกเซิร์ฟเวอร์ที่ทำงานแบบกระจายจะต้องออนไลน์ (พร้อมทำงาน) ด้วยกันทั้งหมด เมื่อทรานแซกชันย่อยที่แต่ละเซิร์ฟเวอร์ทำเสร็จก็จะถูกคอมมิทและจัดการด้วยขั้นตอนตามโปรโตคอล 2-phase commit ซึ่งหากข้อผิดพลาดเกิดขึ้นแม้แต่จุดเดียวทรานแซกชันโดยรวมจะถูกยกเลิก แต่หากไม่มีข้อผิดพลาดเกิดขึ้นเลย สภาพข้อมูลในทุกเซิร์ฟเวอร์ก็จะถูกอัพเดตไปพร้อมกัน เสมือนไม่มีดีเลย์ในทุกเซิร์ฟเวอร์ ถ้ามองในแง่ความสัมพันธ์แล้วกล่าวได้ว่าสภาพข้อมูลไม่เป็นอิสระจากกัน (ต้องถูกจัดการให้ถูกต้องเหมือนกันพร้อมกันไปตลอดเวลาในทุกเซิร์ฟเวอร์)</p>
<p>ทีนี้หากต้องเลือกสักทางเลือกก็คงต้องดูว่าระบบฐานข้อมูลนั้น ยอมรับได้แค่ไหนในระดับความเป็นอิสระจากกันของสภาพข้อมูลแต่ละเซิร์ฟเวอร์ (ต้องถูกต้องเหมือนกันตลอดเวลา หรือยอมให้ข้อมูลแต่ละเซิรฟเวอร์มีสภาพต่างกันได้บ้าง) &lt;&lt; <strong>ความเป็นอิสระจากกันของสภาพข้อมูลของแต่ละเซิร์ฟเวอร์</strong> = <strong>site autonomy</strong> &gt;&gt;</p>
<p>มาถึงตรงนี้ก็สามารถโยงไปถึง 3 ชนิดของ SQL Server replication ได้แล้วอันได้แก่</p>
<ol>
<li><strong>Snapshot replication</strong> เป็นชนิดที่เรียบง่ายที่สุด ไม่มีการจัดการที่ซับซ้อนเหมือนอีก 2 ชนิด โดย publication ทั้งก้อนเต็มๆจาก publisher จะเป็นสิ่งเดียวที่จะนำมาใช้งาน ข้อมูลpublication แบบนี้ไมโครซอฟท์เรียกมันว่า snapshot (อันที่จริงข้อมูล snapshot นี้ replication อีก 2 ชนิดก็มีการใช้งานด้วยเช่นกัน) ข้อมูลการเปลี่ยนแปลงย่อยๆอื่นๆจะไม่มีการนำใช้ใน replication ชนิดนี้</li>
<li><strong>Transactional replication</strong> เริ่มต้นการทำงานนั้น publication แรกจะถือเป็นข้อมูล snapshot (ข้อมูลก้อนใหญ่ที่ใช้เป็นพื้นฐานแบบเดียวกับที่ snapshot replication ใช้) แต่มีความพิเศษตรงที่เมื่อมีการเปลี่ยนแปลงเกิดขึ้นกับ article (ลองย้อนกลับไปดูความหมายในตอนที่แล้วนะครับ) รายละเอียดการเปลี่ยนแปลงนั้นก็จะถูกรวบรวมจาก transaction log และนำส่งออกไปที่ subscriber อย่างต่อเนื่อง</li>
<li><strong>Merge replication</strong> คล้ายกับ transactional replication ในด้านการรวบรวมความเปลี่ยนแปลงของข้อมูลอย่างต่อเนื่อง แต่แทนที่จะส่งออกไปอย่างต่อเนื่องเช่นกัน จะมีการรวบรวมเป็นก้อนใหญ่กว่าแล้วค่อยส่งในลักษณะ batch ด้วยช่วงเวลาที่นานขึ้น นอกจากนี้ merge replication ยังมีการจัดการความขัดแย้งของข้อมูล (conflict resolver) ที่ดีเยี่ยมอีกด้วยเมื่อนำข้อมูลมาผสานหรือ merge กัน</li>
</ol>
<p>หลังจากได้รู้จักกับทั้ง 3 ชนิดแล้ว ผู้อ่านอาจสงสัยว่ามันโยงกันหรือเปรียบเทียบกันได้อย่างไรกับ &#8216;การประมวลผล distributed transactions ร่วมกับ DTC&#8217; ที่กล่าวถึงไปก่อนหน้านี้ บางคนอาจเดาได้แล้ว ใช่แล้วครับ&#8230;ประเด็น&#8217;ระดับความเป็นอิสระของสภาพข้อมูล&#8217; นั่นเอง</p>
<p><a href="http://coresharp.net/images/90ebe27e81e2_14E62/Replication02_012.png"><img style="border-width: 0px;" src="http://coresharp.net/images/90ebe27e81e2_14E62/Replication02_01_thumb.png" border="0" alt="" width="640" height="480" /></a></p>
<p>จากรูปจะเห็นว่ากับการประมวลผล distributed transactions ร่วมกับ DTC นั้น &#8216;ระดับความเป็นอิสระจากกันของสภาพข้อมูล&#8217; จะต่ำที่สุด จากนั้นก็จะไล่ไปที่ transactional replication และที่สูงที่สุดคือ merge replication</p>
<p>หรือกล่าวได้ว่า merge replication เป็นรูปแบบการทำงานที่แต่ละเซิร์ฟเวอร์ทำงานเป็นอิสระต่อกันสูงมาก เมื่อถึงเวลาอันเหมาะสมเวลาหนึ่งข้อมูลจากแต่ละเซิร์ฟเวอร์ก็จะถูกนำมาผสานกัน แน่นอนล่ะความขัดแย้งมีโอกาสเกิดขึ้นได้สูงเพราะต่างฝ่ายต่างทำงานเป็นอิสระจากกัน แต่ที่เซิร์ฟเวอร์ศูนย์กลางก็สามารถระบุเงื่อนไขและขั้นตอนสำหรับการจัดการกับความขัดแย้งดังกล่าวได้</p>
<p>และตอนนี้ก็สามารถโยงต่อมาได้ที่ Pocket PC applications ถึงเหตุผลที่ควรเลือกใช้ merge replication หลายคนคงเดาได้อีกว่าเพราะ Pocket PC นั้นจะให้ทำงานโดยเชื่อมต่อกับฐานข้อมูลศูนย์กลางตลอดเวลาคงลำบากหรือเป็นไปไม่ได้ ต้องใช้รูปแบบการทำงานแบบกระจายและต้องมีความเป็นอิสระสูงด้วย เมื่อถึงเวลาที่ต้องส่งข้อมูล (ที่บันทึกในไฟล์ sdf) ไปผสานที่ศูนย์กลางต้องคำนึงถึงวิธีการจัดการกับความขัดแย้งของข้อมูลที่อาจเกิดขึ้นด้วย (ตัวอย่างเช่น การบันทึกข้อมูลข่าวจากนักข่าวหลายๆคนใน Pocket PC ซึ่งเนื้อหาของข่าวเดียวกันอาจต่างกันได้ นั่นจึงต้องมีวิธีจัดการเมื่อนำมาผสานกันที่ศูนย์กลาง)</p>
<p><a href="http://coresharp.net/images/90ebe27e81e2_14E62/Replication02_022.png"><img style="border-width: 0px;" src="http://coresharp.net/images/90ebe27e81e2_14E62/Replication02_02_thumb.png" border="0" alt="" width="640" height="480" /></a></p>
<p>ที่จริงแล้วอยากบรรยายต่อในเรื่องของบรรดา agents ซึ่งพวกมันเป็นเซอร์วิสคอมโพเนนท์ที่ช่วยกันทำงาน replication ให้ลุล่วงไปได้ แต่จะทำให้บทความนี้ห่างไกลจากความเป็นบทความของ developer แต่จะกลายเป็นเข้าใกล้การเป็นบทความของ DBA ซะมากกว่า</p>
]]></content:encoded>
			<wfw:commentRss>http://devzonedd.homeip.net/?feed=rss2&amp;p=172</wfw:commentRss>
		</item>
		<item>
		<title>การเขียน function เพื่อ print เฉพาะส่วนของ หน้าเว็บ</title>
		<link>http://devzonedd.homeip.net/?p=166</link>
		<comments>http://devzonedd.homeip.net/?p=166#comments</comments>
		<pubDate>Mon, 16 Mar 2009 05:07:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://devzonedd.homeip.net/?p=166</guid>
		<description><![CDATA[สำหรับในบทความนี้นะครับ หลายคนคงเคยประสบปัญหาในเรื่องการ ใช้ window.print มานะแล้วนะครับ ซึ่ง จะเป็นการ print ทั้งหน้าเว็บ ซึ่งจะรวมเอาส่วน head และ footer ของเว็บเข้าไปด้วย ทำให้ การ print นั้นไม่ค่อยจะ สวยเท่าที่ควรนะครับ
หรือจะใช้วิธีการสร้าง page ใหม่ เพื่อแสดงผลในรูปแบบ ทีเราต้องการก่อน print ก็เป็นวิธีแก้ไขที่ใช้ได้นะครับ แต่เราจะต้องเสียเวลาในการสร้าง web page ใหม่ หากมีการติดต่อกับฐานข้อมูลก็ต้อง เขียนโคดติดต่อใหม่ ต้องเสียเวลาประมวลผลอีกนั่นแหละครับ
ในบทความนี้ ผมจึงได้สร้าง javascript เพื่อทำหน้าที่ popup window แล้วนำข้อมูลจากส่วนที่ต้องการ ไปใส่ไว้ใน popup window เพื่อ print ในรูปแบบทีเราต้องการได้ โดยไม่ต้อง สร้าง webpage หรือเขียนติดต่อดาต้าเบสใหม่ นะครับ

ฟังชั่น printContentDiv
function printContentDiv(content){
var printReady = document.getElementById(content);
var txt= [...]]]></description>
			<content:encoded><![CDATA[<p>สำหรับในบทความนี้นะครับ หลายคนคงเคยประสบปัญหาในเรื่องการ ใช้ window.print มานะแล้วนะครับ ซึ่ง จะเป็นการ print ทั้งหน้าเว็บ ซึ่งจะรวมเอาส่วน head และ footer ของเว็บเข้าไปด้วย ทำให้ การ print นั้นไม่ค่อยจะ สวยเท่าที่ควรนะครับ</p>
<p>หรือจะใช้วิธีการสร้าง page ใหม่ เพื่อแสดงผลในรูปแบบ ทีเราต้องการก่อน print ก็เป็นวิธีแก้ไขที่ใช้ได้นะครับ แต่เราจะต้องเสียเวลาในการสร้าง web page ใหม่ หากมีการติดต่อกับฐานข้อมูลก็ต้อง เขียนโคดติดต่อใหม่ ต้องเสียเวลาประมวลผลอีกนั่นแหละครับ</p>
<p>ในบทความนี้ ผมจึงได้สร้าง javascript เพื่อทำหน้าที่ popup window แล้วนำข้อมูลจากส่วนที่ต้องการ ไปใส่ไว้ใน popup window เพื่อ print ในรูปแบบทีเราต้องการได้ โดยไม่ต้อง สร้าง webpage หรือเขียนติดต่อดาต้าเบสใหม่ นะครับ</p>
<p><span id="more-166"></span><br />
ฟังชั่น printContentDiv</p>
<blockquote><p>function printContentDiv(content){<br />
var printReady = document.getElementById(content);<br />
var txt= &#8216;\n\n&#8217;;</p>
<p>if (document.getElementsByTagName != null){<br />
var txtheadTags = document.getElementsByTagName(&#8221;head&#8221;);<br />
if (txtheadTags.length &gt; 0){<br />
var str=txtheadTags[0].innerHTML;<br />
txt += str; // str.replace(/funChkLoad();/ig, &#8221; &#8220;);<br />
}<br />
}<br />
txt += &#8216;\n\n&#8217;;<br />
if (printReady != null){<br />
txt += printReady.innerHTML;<br />
}<br />
txt += &#8216;\n\n&#8217;;<br />
var printWin = window.open();<br />
printWin.document.open();<br />
printWin.document.write(txt);<br />
printWin.document.close();<br />
printWin.print();</p>
<p>}</p></blockquote>
<p>จากฟังชั่นด้านบน อธิบายได้ว่า เราจะมีการนำเอาข้อมูลที่อยู่ภายในแทก div ที่เราต้องการ ด้วย InnerHTML ไปใส่ในข้อมูลชุดใหม่ แล้วสั่ง popup เพื่อแสดงผลหน้า page ใหม่เพื่อ print นั่นเอง เนื่องจาก ในส่วน header ของ page อาจจะมีการ เรียกใช้ javascript หรือ css ต่างๆ ดังนั้นเราจึง ต้องนำ element head ไปใส่ไว้ใน popup window ด้วย เพื่อให้ ส่วนที่แสดงผล ใน body ใกล้เคียงกับ หน้า page จริงมากที่สุด</p>
<p>สำหรับการใช้ function นี้นะครับ ให้เรา ใส่ แทก</p>
<p>&lt;div&gt;ล้อมกรอบบริเวณที่เราต้องการจะ print นะครับ ดังตัวอย่าง</p>
<p>&lt;html&gt;<br />
&lt;head&gt;</p>
<p>&lt;script language=&#8221;javascript&#8221;&gt;<br />
&lt;!&#8211;<br />
function printContentDiv(content){<br />
var printReady = document.getElementById(content);<br />
var txt= &#8216;\n\n&#8217;;</p>
<p>if (document.getElementsByTagName != null){<br />
var txtheadTags = document.getElementsByTagName(&#8221;head&#8221;);<br />
if (txtheadTags.length &amp;gt; 0){<br />
var str=txtheadTags[0].innerHTML;<br />
txt += str; // str.replace(/funChkLoad();/ig, &#8221; &#8220;);<br />
}<br />
}<br />
txt += &#8216;\n\n&#8217;;<br />
if (printReady != null){<br />
txt += printReady.innerHTML;<br />
}<br />
txt += &#8216;\n\n&#8217;;<br />
var printWin = window.open();<br />
printWin.document.open();<br />
printWin.document.write(txt);<br />
printWin.document.close();<br />
printWin.print();<br />
}<br />
// &#8211;&gt;<br />
&lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;</p>
<p>ส่วน header&lt;br&gt;<br />
&lt;div id=&#8221;lblPrint&#8221;&gt;ข้อความส่วนที่จะพิมพ์&lt;/div&gt;<br />
ส่วน footer&lt;br&gt;<br />
&lt;a href=&#8221;javascript:printContentDiv(&#8217;lblPrint&#8217;);&#8221;&gt;พิมพ์หน้านี้&lt;/a&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p>
<p>ผลลัพธ์ที่ได้ คือ ข้อความที่อยู่ใน div ชื่อ lblPrint เท่านั้น</p>
]]></content:encoded>
			<wfw:commentRss>http://devzonedd.homeip.net/?feed=rss2&amp;p=166</wfw:commentRss>
		</item>
		<item>
		<title>บทสรุป Object มาตรฐานใน javascript</title>
		<link>http://devzonedd.homeip.net/?p=164</link>
		<comments>http://devzonedd.homeip.net/?p=164#comments</comments>
		<pubDate>Mon, 16 Mar 2009 04:53:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://devzonedd.homeip.net/?p=164</guid>
		<description><![CDATA[ออปเจ็คต์มาตรฐานในจาวาสคริปต์ (จาก w3schools.com)
ในบทความนี้ก็จะเป็นส่วนสุดท้ายสำหรับ javascript เบื้องต้น แล้วนะครับ เป็นการรวม method และ function มาตรฐาน ที่ javascript ได้เตรียมไว้ให้เรียกใช้งานได้ซึ่งได้นำมาจากเว็บ w3school.com นะครับ หลังจากบทความนี้จบ ก็จะเป็นตัวอย่าง ในการใช้งานสำคัญของ javascript อื่นๆนะครับ 

Array Object Methods
FF: Firefox, N: Netscape, IE: Internet Explorer



Method


Description


FF


N


IE




concat()


Joins two or more arrays and returns the result


1


4


4




join()


Puts all the elements of an array into a string. The elements are separated by a specified delimiter


1


3


4




pop()


Removes [...]]]></description>
			<content:encoded><![CDATA[<p><strong><u>ออปเจ็คต์มาตรฐานในจาวาสคริปต์ (จาก </u></strong><u>w3schools.com)<strong></strong></u></p>
<p>ในบทความนี้ก็จะเป็นส่วนสุดท้ายสำหรับ javascript เบื้องต้น แล้วนะครับ เป็นการรวม method และ function มาตรฐาน ที่ javascript ได้เตรียมไว้ให้เรียกใช้งานได้ซึ่งได้นำมาจากเว็บ w3school.com นะครับ หลังจากบทความนี้จบ ก็จะเป็นตัวอย่าง ในการใช้งานสำคัญของ javascript อื่นๆนะครับ </p>
<p><span id="more-164"></span></p>
<h2>Array Object Methods</h2>
<p><strong>FF</strong>: Firefox, <strong>N</strong>: Netscape, <strong>IE</strong>: Internet Explorer</p>
<table cellSpacing=0 cellPadding=0 width="100%" border=1>
<tr>
<td vAlign=top width="20%">
<p><strong>Method</strong><strong></strong></p>
</td>
<td vAlign=top width="68%">
<p><strong>Description</strong><strong></strong></p>
</td>
<td vAlign=top width="4%">
<p><strong>FF</strong><strong></strong></p>
</td>
<td vAlign=top width="4%">
<p><strong>N</strong><strong></strong></p>
</td>
<td vAlign=top width="4%">
<p><strong>IE</strong><strong></strong></p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_concat_array.html" target=_blank>concat()</a></p>
</td>
<td vAlign=top>
<p>Joins two or more arrays and returns the result</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_join.html" target=_blank>join()</a></p>
</td>
<td vAlign=top>
<p>Puts all the elements of an array into a string. The elements are separated by a specified delimiter</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_pop.html" target=_blank>pop()</a></p>
</td>
<td vAlign=top>
<p>Removes and returns the last element of an array</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>5.5</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_push.html" target=_blank>push()</a></p>
</td>
<td vAlign=top>
<p>Adds one or more elements to the end of an array and returns the new length</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>5.5</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_reverse.html" target=_blank>reverse()</a></p>
</td>
<td vAlign=top>
<p>Reverses the order of the elements in an array</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_shift.html" target=_blank>shift()</a></p>
</td>
<td vAlign=top>
<p>Removes and returns the first element of an array</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>5.5</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_slice_array.html" target=_blank>slice()</a></p>
</td>
<td vAlign=top>
<p>Returns selected elements from an existing array</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_sort.html" target=_blank>sort()</a></p>
</td>
<td vAlign=top>
<p>Sorts the elements of an array</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_splice.html">splice()</a></p>
</td>
<td vAlign=top>
<p>Removes and adds new elements to an array</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>5.5</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_toSource_array.html">toSource()</a></p>
</td>
<td vAlign=top>
<p>Represents the source code of an object</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>-</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_toString_array.html" target=_blank>toString()</a></p>
</td>
<td vAlign=top>
<p>Converts an array to a string and returns the result</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_unshift.html" target=_blank>unshift()</a></p>
</td>
<td vAlign=top>
<p>Adds one or more elements to the beginning of an array and returns the new length</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>6</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_valueOf_array.html" target=_blank>valueOf()</a></p>
</td>
<td vAlign=top>
<p>Returns the primitive value of an Array object</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
</table>
<p>&nbsp;</p>
<div align=center>
<hr align=center width="100%" SIZE=2>
</div>
<h2>Array Object Properties</h2>
<table cellSpacing=0 cellPadding=0 width="100%" border=1>
<tr>
<td width="20%">
<p><strong>Property</strong><strong></strong></p>
</td>
<td width="68%">
<p><strong>Description</strong><strong></strong></p>
</td>
<td width="4%">
<p><strong>FF</strong><strong></strong></p>
</td>
<td width="4%">
<p><strong>N</strong><strong></strong></p>
</td>
<td width="4%">
<p><strong>IE&nbsp;</strong><strong></strong></p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_constructor_array.html">constructor</a></p>
</td>
<td vAlign=top>
<p>A reference to the function that created the object</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p>index</p>
</td>
<td vAlign=top>
<p>&nbsp;</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p>input</p>
</td>
<td vAlign=top>
<p>&nbsp;</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_length_array.html">length</a></p>
</td>
<td vAlign=top>
<p>Sets or returns the number of elements in an array</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_prototype_array.html">prototype</a></p>
</td>
<td vAlign=top>
<p>Allows you to add properties and methods to the object</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
</table>
<p>&nbsp;</p>
<div align=center>
<hr align=center width="100%" SIZE=2>
</div>
<p>&nbsp;</p>
<h2>Boolean Object Methods</h2>
<p><strong>FF</strong>: Firefox, <strong>N</strong>: Netscape, <strong>IE</strong>: Internet Explorer</p>
<table cellSpacing=0 cellPadding=0 width="100%" border=1>
<tr>
<td vAlign=top width="20%">
<p><strong>Method</strong><strong></strong></p>
</td>
<td vAlign=top width="63%">
<p><strong>Description</strong><strong></strong></p>
</td>
<td vAlign=top width="4%">
<p><strong>FF</strong><strong></strong></p>
</td>
<td vAlign=top width="4%">
<p><strong>N</strong><strong></strong></p>
</td>
<td vAlign=top width="4%">
<p><strong>IE</strong><strong></strong></p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_toSource_boolean.html">toSource()</a></p>
</td>
<td vAlign=top>
<p>Represents the source code of an object</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>-</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_toString_boolean.html" target=_blank>toString()</a></p>
</td>
<td vAlign=top>
<p>Converts a Boolean value to a string and returns the result</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_valueOf_boolean.html" target=_blank>valueOf()</a></p>
</td>
<td vAlign=top>
<p>Returns the primitive value of a Boolean object</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
</table>
<p>&nbsp;</p>
<div align=center>
<hr align=center width="100%" SIZE=2>
</div>
<h2>Boolean Object Properties</h2>
<table cellSpacing=0 cellPadding=0 width="100%" border=1>
<tr>
<td width="20%">
<p><strong>Property</strong><strong></strong></p>
</td>
<td width="63%">
<p><strong>Description</strong><strong></strong></p>
</td>
<td width="4%">
<p><strong>FF</strong><strong></strong></p>
</td>
<td width="4%">
<p><strong>N</strong><strong></strong></p>
</td>
<td width="4%">
<p><strong>IE&nbsp;</strong><strong></strong></p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_constructor_boolean.html">constructor</a></p>
</td>
<td vAlign=top>
<p>A reference to the function that created the object</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_prototype_boolean.html">prototype</a></p>
</td>
<td vAlign=top>
<p>Allows you to add properties and methods to the object</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
</table>
<p>&nbsp;</p>
<div align=center>
<hr align=center width="100%" SIZE=2>
</div>
<h2>Date Object Methods</h2>
<p><strong>FF</strong>: Firefox, <strong>N</strong>: Netscape, <strong>IE</strong>: Internet Explorer</p>
<table cellSpacing=0 cellPadding=0 width="100%" border=1>
<tr>
<td width="27%">
<p><strong>Method</strong><strong></strong></p>
</td>
<td width="61%">
<p><strong>Description</strong><strong></strong></p>
</td>
<td width="4%">
<p><strong>FF</strong><strong></strong></p>
</td>
<td width="4%">
<p><strong>N</strong><strong></strong></p>
</td>
<td width="4%">
<p><strong>IE</strong><strong></strong></p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_Date.html" target=_blank>Date()</a></p>
</td>
<td vAlign=top>
<p>Returns today&#8217;s date and time</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_getDate.html" target=_blank>getDate()</a></p>
</td>
<td vAlign=top>
<p>Returns the day of the month from a Date object (from 1-31)</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_getDay.html" target=_blank>getDay()</a></p>
</td>
<td vAlign=top>
<p>Returns the day of the week from a Date object (from 0-6)</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_getMonth.html" target=_blank>getMonth()</a></p>
</td>
<td vAlign=top>
<p>Returns the month from a Date object (from 0-11)</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_getFullYear.html" target=_blank>getFullYear()</a></p>
</td>
<td vAlign=top>
<p>Returns the year, as a four-digit number, from a Date object </p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_getYear.html" target=_blank>getYear()</a></p>
</td>
<td vAlign=top>
<p>Returns the year, as a two-digit or a four-digit number, from a Date object. Use getFullYear() instead !!</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_getHours.html" target=_blank>getHours()</a></p>
</td>
<td vAlign=top>
<p>Returns the hour of a Date object (from 0-23)</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_getMinutes.html" target=_blank>getMinutes()</a></p>
</td>
<td vAlign=top>
<p>Returns the minutes of a Date object (from 0-59)</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_getSeconds.html" target=_blank>getSeconds()</a></p>
</td>
<td vAlign=top>
<p>Returns the seconds of a Date object (from 0-59)</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_getMilliseconds.html" target=_blank>getMilliseconds()</a></p>
</td>
<td vAlign=top>
<p>Returns the milliseconds of a Date object (from 0-999)</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_getTime.html" target=_blank>getTime()</a></p>
</td>
<td vAlign=top>
<p>Returns the number of milliseconds since <st1:time w:st="on" Minute="0" Hour="0">midnight</st1:time> <st1:date w:st="on" Year="1970" Day="1" Month="1">Jan 1, 1970</st1:date></p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_getTimezoneOffset.html" target=_blank>getTimezoneOffset()</a></p>
</td>
<td vAlign=top>
<p>Returns the difference in minutes between local time and Greenwich Mean Time (GMT)</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_getUTCDate.html" target=_blank>getUTCDate()</a></p>
</td>
<td vAlign=top>
<p>Returns the day of the month from a Date object according to universal time (from 1-31)</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_getUTCDay.html" target=_blank>getUTCDay()</a></p>
</td>
<td vAlign=top>
<p>Returns the day of the week from a Date object according to universal time (from 0-6)</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_getUTCMonth.html" target=_blank>getUTCMonth()</a></p>
</td>
<td vAlign=top>
<p>Returns the month from a Date object according to universal time (from 0-11)</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_getUTCFullYear.html" target=_blank>getUTCFullYear()</a></p>
</td>
<td vAlign=top>
<p>Returns the four-digit year from a Date object according to universal time</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_getUTCHours.html" target=_blank>getUTCHours()</a></p>
</td>
<td vAlign=top>
<p>Returns the hour of a Date object according to universal time (from 0-23)</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_getUTCMinutes.html" target=_blank>getUTCMinutes()</a></p>
</td>
<td vAlign=top>
<p>Returns the minutes of a Date object according to universal time (from 0-59)</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_getUTCSeconds.html" target=_blank>getUTCSeconds()</a></p>
</td>
<td vAlign=top>
<p>Returns the seconds of a Date object according to universal time (from 0-59)</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_getUTCMilliseconds.html" target=_blank>getUTCMilliseconds()</a></p>
</td>
<td vAlign=top>
<p>Returns the milliseconds of a Date object according to universal time (from 0-999)</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_parse.html" target=_blank>parse()</a></p>
</td>
<td vAlign=top>
<p>Takes a date string and returns the number of milliseconds since <st1:time w:st="on" Minute="0" Hour="0">midnight</st1:time> of <st1:date w:st="on" Year="1970" Day="1" Month="1">January 1, 1970</st1:date></p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_setDate.html" target=_blank>setDate()</a></p>
</td>
<td vAlign=top>
<p>Sets the day of the month in a Date object (from 1-31)</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_setMonth.html" target=_blank>setMonth()</a></p>
</td>
<td vAlign=top>
<p>Sets the month in a Date object (from 0-11)</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_setFullYear.html" target=_blank>setFullYear()</a></p>
</td>
<td vAlign=top>
<p>Sets the year in a Date object (four digits)</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_setYear.html" target=_blank>setYear()</a></p>
</td>
<td vAlign=top>
<p>Sets the year in the Date object (two or four digits). Use setFullYear() instead !!</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_setHours.html" target=_blank>setHours()</a></p>
</td>
<td vAlign=top>
<p>Sets the hour in a Date object (from 0-23)</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_setMinutes.html" target=_blank>setMinutes()</a></p>
</td>
<td vAlign=top>
<p>Set the minutes in a Date object (from 0-59)</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_setSeconds.html" target=_blank>setSeconds()</a></p>
</td>
<td vAlign=top>
<p>Sets the seconds in a Date object (from 0-59)</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_setMilliseconds.html" target=_blank>setMilliseconds()</a></p>
</td>
<td vAlign=top>
<p>Sets the milliseconds in a Date object (from 0-999)</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_setTime.html" target=_blank>setTime()</a></p>
</td>
<td vAlign=top>
<p>Calculates a date and time by adding or subtracting a specified number of milliseconds to/from <st1:time w:st="on" Minute="0" Hour="0">midnight</st1:time> <st1:date w:st="on" Year="1970" Day="1" Month="1">January 1, 1970</st1:date></p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_setUTCDate.html" target=_blank>setUTCDate()</a></p>
</td>
<td vAlign=top>
<p>Sets the day of the month in a Date object according to universal time (from 1-31)</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_setUTCMonth.html" target=_blank>setUTCMonth()</a></p>
</td>
<td vAlign=top>
<p>Sets the month in a Date object according to universal time (from 0-11)</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_setUTCFullYear.html" target=_blank>setUTCFullYear()</a></p>
</td>
<td vAlign=top>
<p>Sets the year in a Date object according to universal time (four digits)</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_setUTCHours.html" target=_blank>setUTCHours()</a></p>
</td>
<td vAlign=top>
<p>Sets the hour in a Date object according to universal time (from 0-23)</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_setUTCMinutes.html" target=_blank>setUTCMinutes()</a></p>
</td>
<td vAlign=top>
<p>Set the minutes in a Date object according to universal time (from 0-59)</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_setUTCSeconds.html" target=_blank>setUTCSeconds()</a></p>
</td>
<td vAlign=top>
<p>Set the seconds in a Date object according to universal time (from 0-59)</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_setUTCMilliseconds.html" target=_blank>setUTCMilliseconds()</a></p>
</td>
<td vAlign=top>
<p>Sets the milliseconds in a Date object according to universal time (from 0-999)</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_toSource_date.html">toSource()</a></p>
</td>
<td vAlign=top>
<p>Represents the source code of an object</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>-</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_toString_date.html" target=_blank>toString()</a></p>
</td>
<td vAlign=top>
<p>Converts a Date object to a string</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_toGMTString.html" target=_blank>toGMTString()</a></p>
</td>
<td vAlign=top>
<p>Converts a Date object, according to Greenwich time, to a string. Use toUTCString() instead !!</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_toUTCString.html" target=_blank>toUTCString()</a></p>
</td>
<td vAlign=top>
<p>Converts a Date object, according to universal time, to a string</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_toLocaleString.html" target=_blank>toLocaleString()</a></p>
</td>
<td vAlign=top>
<p>Converts a Date object, according to local time, to a string</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_utc.html">UTC()</a></p>
</td>
<td vAlign=top>
<p>Takes a date and returns the number of milliseconds since <st1:time w:st="on" Minute="0" Hour="0">midnight</st1:time> of <st1:date w:st="on" Year="1970" Day="1" Month="1">January 1, 1970</st1:date> according to universal time</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_valueOf_date.html">valueOf()</a></p>
</td>
<td vAlign=top>
<p>Returns the primitive value of a Date object</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
</table>
<p>&nbsp;</p>
<div align=center>
<hr align=center width="100%" SIZE=2>
</div>
<h2>Date Object Properties</h2>
<table cellSpacing=0 cellPadding=0 width="100%" border=1>
<tr>
<td width="27%">
<p><strong>Property</strong><strong></strong></p>
</td>
<td width="61%">
<p><strong>Description</strong><strong></strong></p>
</td>
<td width="4%">
<p><strong>FF</strong><strong></strong></p>
</td>
<td width="4%">
<p><strong>N</strong><strong></strong></p>
</td>
<td width="4%">
<p><strong>IE&nbsp;</strong><strong></strong></p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_constructor_date.html">constructor</a></p>
</td>
<td vAlign=top>
<p>A reference to the function that created the object</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_prototype_date.html">prototype</a></p>
</td>
<td vAlign=top>
<p>Allows you to add properties and methods to the object</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
</table>
<p>&nbsp;</p>
<div align=center>
<hr align=center width="100%" SIZE=2>
</div>
<h2>Math Object Methods</h2>
<p><strong>FF</strong>: Firefox, <strong>N</strong>: Netscape, <strong>IE</strong>: Internet Explorer</p>
<table cellSpacing=0 cellPadding=0 width="100%" border=1>
<tr>
<td vAlign=top width="23%">
<p><strong>Method</strong><strong></strong></p>
</td>
<td vAlign=top width="70%">
<p><strong>Description</strong><strong></strong></p>
</td>
<td vAlign=top width="4%">
<p><strong>FF</strong><strong></strong></p>
</td>
<td vAlign=top width="4%">
<p><strong>N</strong><strong></strong></p>
</td>
<td vAlign=top width="4%">
<p><strong>IE</strong><strong></strong></p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_abs.html" target=_blank>abs(x)</a></p>
</td>
<td vAlign=top>
<p>Returns the absolute value of a number</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_acos.html" target=_blank>acos(x)</a></p>
</td>
<td vAlign=top>
<p>Returns the arccosine of a number</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_asin.html" target=_blank>asin(x)</a></p>
</td>
<td vAlign=top>
<p>Returns the arcsine of a number</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_atan.html" target=_blank>atan(x)</a></p>
</td>
<td vAlign=top>
<p>Returns the arctangent of x as a numeric value between -PI/2 and PI/2 radians</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_atan.html" target=_blank>atan2(y,x)</a></p>
</td>
<td vAlign=top>
<p>Returns the angle theta of an (x,y) point as a numeric value between -PI and PI radians</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_ceil.html" target=_blank>ceil(x)</a></p>
</td>
<td vAlign=top>
<p>Returns the value of a number rounded upwards to the nearest integer</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_cos.html" target=_blank>cos(x)</a></p>
</td>
<td vAlign=top>
<p>Returns the cosine of a number</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_exp.html" target=_blank>exp(x)</a></p>
</td>
<td vAlign=top>
<p>Returns the value of E<sup>x</sup></p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_floor.html" target=_blank>floor(x)</a></p>
</td>
<td vAlign=top>
<p>Returns the value of a number rounded downwards to the nearest integer</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_log.html" target=_blank>log(x)</a></p>
</td>
<td vAlign=top>
<p>Returns the natural logarithm (base E) of a number</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_max.html" target=_blank>max(x,y)</a></p>
</td>
<td vAlign=top>
<p>Returns the number with the highest value of x and y</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_min.html" target=_blank>min(x,y)</a></p>
</td>
<td vAlign=top>
<p>Returns the number with the lowest value of x and y</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_pow.html" target=_blank>pow(x,y)</a></p>
</td>
<td vAlign=top>
<p>Returns the value of x to the power of y</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_random.html" target=_blank>random()</a></p>
</td>
<td vAlign=top>
<p>Returns a random number between 0 and 1</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_round.html" target=_blank>round(x)</a></p>
</td>
<td vAlign=top>
<p>Rounds a number to the nearest integer</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_sin.html" target=_blank>sin(x)</a></p>
</td>
<td vAlign=top>
<p>Returns the sine of a number</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_sqrt.html" target=_blank>sqrt(x)</a></p>
</td>
<td vAlign=top>
<p>Returns the square root of a number</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_tan.html" target=_blank>tan(x)</a></p>
</td>
<td vAlign=top>
<p>Returns the tangent of an angle</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_toSource_math.html">toSource()</a></p>
</td>
<td vAlign=top>
<p>Represents the source code of an object</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>-</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_valueOf_math.html">valueOf()</a></p>
</td>
<td vAlign=top>
<p>Returns the primitive value of a Math object</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
</table>
<p>&nbsp;</p>
<div align=center>
<hr align=center width="100%" SIZE=2>
</div>
<h2>Math Object Properties</h2>
<table cellSpacing=0 cellPadding=0 width="100%" border=1>
<tr>
<td width="23%">
<p><strong>Property</strong><strong></strong></p>
</td>
<td width="70%">
<p><strong>Description</strong><strong></strong></p>
</td>
<td width="4%">
<p><strong>FF</strong><strong></strong></p>
</td>
<td width="4%">
<p><strong>N</strong><strong></strong></p>
</td>
<td width="4%">
<p><strong>IE&nbsp;</strong><strong></strong></p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_constructor_math.html">constructor</a></p>
</td>
<td vAlign=top>
<p>A reference to the function that created the object</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p>E</p>
</td>
<td vAlign=top>
<p>Returns Euler&#8217;s constant (approx. 2.718)</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p>LN2</p>
</td>
<td vAlign=top>
<p>Returns the natural logarithm of 2 (approx. 0.693)</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p>LN10</p>
</td>
<td vAlign=top>
<p>Returns the natural logarithm of 10 (approx. 2.302)</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p>LOG2E</p>
</td>
<td vAlign=top>
<p>Returns the base-2 logarithm of E (approx. 1.442)</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p>LOG10E</p>
</td>
<td vAlign=top>
<p>Returns the base-10 logarithm of E (approx. 0.434)</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p>PI</p>
</td>
<td vAlign=top>
<p>Returns PI (approx. 3.14159)</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_prototype_math.html">prototype</a></p>
</td>
<td vAlign=top>
<p>Allows you to add properties and methods to the object</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p>SQRT1_2</p>
</td>
<td vAlign=top>
<p>Returns the square root of 1/2 (approx. 0.707)</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p>SQRT2</p>
</td>
<td vAlign=top>
<p>Returns the square root of 2 (approx. 1.414)</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
</table>
<p>&nbsp;</p>
<div align=center>
<hr align=center width="100%" SIZE=2>
</div>
<h2>String Object Methods</h2>
<p><strong>FF</strong>: Firefox, <strong>N</strong>: Netscape, <strong>IE</strong>: Internet Explorer</p>
<table cellSpacing=0 cellPadding=0 width="100%" border=1>
<tr>
<td vAlign=top width="23%">
<p><strong>Method</strong><strong></strong></p>
</td>
<td vAlign=top width="65%">
<p><strong>Description</strong><strong></strong></p>
</td>
<td vAlign=top width="4%">
<p><strong>FF</strong><strong></strong></p>
</td>
<td vAlign=top width="4%">
<p><strong>N</strong><strong></strong></p>
</td>
<td vAlign=top width="4%">
<p><strong>IE</strong><strong></strong></p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_anchor.html" target=_blank>anchor()</a></p>
</td>
<td vAlign=top>
<p>Creates an HTML anchor</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_big.html" target=_blank>big()</a></p>
</td>
<td vAlign=top>
<p>Displays a string in a big font</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_blink.html" target=_blank>blink()</a></p>
</td>
<td vAlign=top>
<p>Displays a blinking string</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>&nbsp;</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_bold.html" target=_blank>bold()</a></p>
</td>
<td vAlign=top>
<p>Displays a string in bold</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_charAt.html" target=_blank>charAt()</a></p>
</td>
<td vAlign=top>
<p>Returns the character at a specified position</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_charCodeAt.html" target=_blank>charCodeAt()</a></p>
</td>
<td vAlign=top>
<p>Returns the Unicode of the character at a specified position</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_concat_string.html" target=_blank>concat()</a></p>
</td>
<td vAlign=top>
<p>Joins two or more strings</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_fixed.html" target=_blank>fixed()</a></p>
</td>
<td vAlign=top>
<p>Displays a string as teletype text</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_fontcolor.html" target=_blank>fontcolor()</a></p>
</td>
<td vAlign=top>
<p>Displays a string in a specified color</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_fontsize.html" target=_blank>fontsize()</a></p>
</td>
<td vAlign=top>
<p>Displays a string in a specified size</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_fromCharCode.html" target=_blank>fromCharCode()</a></p>
</td>
<td vAlign=top>
<p>Takes the specified Unicode values and returns a string</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_indexOf.html" target=_blank>indexOf()</a></p>
</td>
<td vAlign=top>
<p>Returns the position of the first occurrence of a specified string value in a string</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_italics.html" target=_blank>italics()</a></p>
</td>
<td vAlign=top>
<p>Displays a string in italic</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_lastIndexOf.html" target=_blank>lastIndexOf()</a></p>
</td>
<td vAlign=top>
<p>Returns the position of the last occurrence of a specified string value, searching backwards from the specified position in a string</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_link.html" target=_blank>link()</a></p>
</td>
<td vAlign=top>
<p>Displays a string as a hyperlink</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_match.html" target=_blank>match()</a></p>
</td>
<td vAlign=top>
<p>Searches for a specified value in a string</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_replace.html" target=_blank>replace()</a></p>
</td>
<td vAlign=top>
<p>Replaces some characters with some other characters in a string</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_search.html" target=_blank>search()</a></p>
</td>
<td vAlign=top>
<p>Searches a string for a specified value</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_slice_string.html" target=_blank>slice()</a></p>
</td>
<td vAlign=top>
<p>Extracts a part of a string and returns the extracted part in a new string</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_small.html" target=_blank>small()</a></p>
</td>
<td vAlign=top>
<p>Displays a string in a small font</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_split.html" target=_blank>split()</a></p>
</td>
<td vAlign=top>
<p>Splits a string into an array of strings</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_strike.html" target=_blank>strike()</a></p>
</td>
<td vAlign=top>
<p>Displays a string with a strikethrough</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_sub.html" target=_blank>sub()</a></p>
</td>
<td vAlign=top>
<p>Displays a string as subscript</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_substr.html" target=_blank>substr()</a></p>
</td>
<td vAlign=top>
<p>Extracts a specified number of characters in a string, from a start index</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_substring.html" target=_blank>substring()</a></p>
</td>
<td vAlign=top>
<p>Extracts the characters in a string between two specified indices</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_sup.html" target=_blank>sup()</a></p>
</td>
<td vAlign=top>
<p>Displays a string as superscript</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_toLowerCase.html" target=_blank>toLowerCase()</a></p>
</td>
<td vAlign=top>
<p>Displays a string in lowercase letters</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_toUpperCase.html" target=_blank>toUpperCase()</a></p>
</td>
<td vAlign=top>
<p>Displays a string in uppercase letters</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_toSource_string.html">toSource()</a></p>
</td>
<td vAlign=top>
<p>Represents the source code of an object</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>-</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_valueOf_string.html">valueOf()</a></p>
</td>
<td vAlign=top>
<p>Returns the primitive value of a String object</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
</table>
<p>&nbsp;</p>
<div align=center>
<hr align=center width="100%" SIZE=2>
</div>
<h2>String Object Properties</h2>
<table cellSpacing=0 cellPadding=0 width="100%" border=1>
<tr>
<td vAlign=top width="23%">
<p><strong>Property</strong><strong></strong></p>
</td>
<td vAlign=top width="65%">
<p><strong>Description</strong><strong></strong></p>
</td>
<td vAlign=top width="4%">
<p><strong>FF</strong><strong></strong></p>
</td>
<td vAlign=top width="4%">
<p><strong>N</strong><strong></strong></p>
</td>
<td vAlign=top width="4%">
<p><strong>IE</strong><strong></strong></p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_constructor_string.html">constructor</a></p>
</td>
<td vAlign=top>
<p>A reference to the function that created the object</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_length_string.html">length</a></p>
</td>
<td vAlign=top>
<p>Returns the number of characters in a string</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_prototype_string.html">prototype</a></p>
</td>
<td vAlign=top>
<p>Allows you to add properties and methods to the object</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
</table>
<p>&nbsp;</p>
<div align=center>
<hr align=center width="100%" SIZE=2>
</div>
<h2>Top-level Functions</h2>
<p><strong>FF</strong>: Firefox, <strong>N</strong>: Netscape, <strong>IE</strong>: Internet Explorer</p>
<table cellSpacing=0 cellPadding=0 width="100%" border=1>
<tr>
<td vAlign=top width="32%">
<p><strong>Function</strong><strong></strong></p>
</td>
<td vAlign=top width="56%">
<p><strong>Description</strong><strong></strong></p>
</td>
<td vAlign=top width="4%">
<p><strong>FF</strong><strong></strong></p>
</td>
<td vAlign=top width="4%">
<p><strong>N</strong><strong></strong></p>
</td>
<td vAlign=top width="4%">
<p><strong>IE</strong><strong></strong></p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_decodeURI.html">decodeURI()</a></p>
</td>
<td vAlign=top>
<p>Decodes an encoded URI</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>5.5</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_decodeURIComponent.html">decodeURIComponent()</a></p>
</td>
<td vAlign=top>
<p>Decodes an encoded URI component</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>5.5</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_encodeURI.html">encodeURI()</a></p>
</td>
<td vAlign=top>
<p>Encodes a string as a URI</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>5.5</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_encodeURIComponent.html">encodeURIComponent()</a></p>
</td>
<td vAlign=top>
<p>Encodes a string as a URI component</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>5.5</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_escape.html" target=_blank>escape()</a></p>
</td>
<td vAlign=top>
<p>Encodes a string</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>-</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_eval.html" target=_blank>eval()</a></p>
</td>
<td vAlign=top>
<p>Evaluates a string and executes it as if it was script code</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_isFinite.html" target=_blank>isFinite()</a></p>
</td>
<td vAlign=top>
<p>Checks if a value is a finite number</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_isNaN.html" target=_blank>isNaN()</a></p>
</td>
<td vAlign=top>
<p>Checks if a value is not a number</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_Number.html" target=_blank>Number()</a></p>
</td>
<td vAlign=top>
<p>Converts an object&#8217;s value to a number</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>&nbsp;</p>
</td>
<td vAlign=top>
<p>&nbsp;</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_parseFloat.html" target=_blank>parseFloat()</a></p>
</td>
<td vAlign=top>
<p>Parses a string and returns a floating point number</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_parseInt.html" target=_blank>parseInt()</a></p>
</td>
<td vAlign=top>
<p>Parses a string and returns an integer</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>2</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_String.html" target=_blank>String()</a></p>
</td>
<td vAlign=top>
<p>Converts an object&#8217;s value to a string</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>&nbsp;</p>
</td>
<td vAlign=top>
<p>&nbsp;</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_unescape.html" target=_blank>unescape()</a></p>
</td>
<td vAlign=top>
<p>Decodes a string encoded by escape()</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>-</p>
</td>
<td vAlign=top>
<p>3</p>
</td>
</tr>
</table>
<p>&nbsp;</p>
<div align=center>
<hr align=center width="100%" SIZE=2>
</div>
<h2>Top-level Properties</h2>
<table cellSpacing=0 cellPadding=0 width="100%" border=1>
<tr>
<td width="32%">
<p><strong>Property</strong><strong></strong></p>
</td>
<td width="56%">
<p><strong>Description</strong><strong></strong></p>
</td>
<td width="4%">
<p><strong>FF</strong><strong></strong></p>
</td>
<td width="4%">
<p><strong>N</strong><strong></strong></p>
</td>
<td width="4%">
<p><strong>IE&nbsp;</strong><strong></strong></p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_infinity.html">Infinity</a></p>
</td>
<td vAlign=top>
<p>A numeric value that represents positive or negative infinity</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_NaN.html" target=_blank>NaN</a></p>
</td>
<td vAlign=top>
<p>Indicates that a value is &#8220;Not a Number&#8221;</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
</tr>
<tr>
<td vAlign=top>
<p><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_undefined.html">undefined</a></p>
</td>
<td vAlign=top>
<p>Indicates that a variable has not been assigned a value</p>
</td>
<td vAlign=top>
<p>1</p>
</td>
<td vAlign=top>
<p>4</p>
</td>
<td vAlign=top>
<p>5.5</p>
</td>
</tr>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><em>หมายเหตุ&nbsp;เอกสารนี้สรุปและมีข้อมูลต่างๆ จากเว็บไซต์ต่อไปนี้</em><em></em></p>
<p><em><a href="http://www.w3schools.com/js_ref/default.asp">http://www.w3schools.com/js_ref/default.asp</a></em></p>
<p><em><a href="http://www.w3schools.com/js/default.asp">http://www.w3schools.com/js/default.asp</a></em></p>
<p><em><a href="http://www.javascriptkit.com/jsref/">http://www.javascriptkit.com/jsref/</a></em></p>
]]></content:encoded>
			<wfw:commentRss>http://devzonedd.homeip.net/?feed=rss2&amp;p=164</wfw:commentRss>
		</item>
		<item>
		<title>บทสรุป Event ต่างๆใน Javascript</title>
		<link>http://devzonedd.homeip.net/?p=162</link>
		<comments>http://devzonedd.homeip.net/?p=162#comments</comments>
		<pubDate>Mon, 16 Mar 2009 04:41:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://devzonedd.homeip.net/?p=162</guid>
		<description><![CDATA[เหตุการณ์มาตรฐานในจาวาสตริปต์ (จาก wc3schools.com)
ในแต่ละแท็กที่ประกอบกันขึ้นด้วยภาษา HTML เพื่อใช้แสดงหน้าเว็บ   หลายๆ แท็กที่ปรากฏนั้นสามารถที่จะตอบสนองต่อเหตุการณ์ต่างๆ ที่เกิดขึ้นได้หลากหลาย ดังเช่น
- เมื่อหน้าเว็บโหลดเสร็จแล้ว หรือเมื่อกำลังจะเปลี่ยนหน้าเว็บไปยังหน้าอื่นหรือปิดหน้าต่าง
- เมื่อผู้ใช้คลิกเลือกหน้าต่างของเว็บบราวเซอร์ หรือเมื่อผู้ใช้คลิกเลือกหน้าต่างโปรแกรมตัวอื่นบนระบบปฏิบัติการ
- เมื่อผู้ใช้เลื่อนเมาส์ไปบนพื้นที่แสดงที่ควบคุมด้วยแท็กนั้นๆ และเมื่อผู้ใช้เลื่อนเมาส์ออกจากพื้นที่แสดง
- เมื่อผู้ใช้คลิกลงไปยังพื้นที่ที่ควบคุมด้วยแท็กนั้นๆ
- เมื่อผู้ใช้แก้ไขข้อมูลที่เป็นองค์ประกอบของฟอร์ม
- เมื่อผู้ใช้กดปุ่ม submit

ในการจัดการต่อเหตุการณ์ต่างๆ เหล่านี้ เราสามารถกระทำได้โดยการอ้างชื่อเหตุการณ์ตามด้วย = และ คำสั่งจาวาสคริปต์ในเครื่องหมาย &#8220;&#8221;  ซึ่งคล้ายคลึงกับการกำหนดแอดตริบิวต์ภายในแท็กทั่วไปนั่นเอง    เหตุการณ์ที่สำคัญมีดังเช่น
 
การโหลดหน้าเว็บและการเปลี่ยน-ปิดเน้าเว็บ
                เหตุการณ์ onload จะเกิดขึ้นเมื่อหน้าเว็บได้รับการอ่านและ parsing เรียบร้อยและได้รับการ render เสร็จสิ้น ส่วนเหตุการณ์ onunload จะเกิดขึ้นเมื่อผู้ใช้คลิกเลือกลิงค์เพื่อเปลี่ยนหน้าเว็บไปยังหน้าอื่น   ปิดหน้าต่างเว็บ หรือป้อน location ใหม่และกด enter เพื่อเปลี่ยนหน้าเว็บไปหน้าอื่น
                การเขียนโค้ดจาวาสคริปต์เพื่อจัดการต่อเหตุการณ์ทั้งสองนี้ จะบรรจุการกำหนดเหตุการณ์ไว้ที่แท็ก &#60;body&#62;
การเลือกองค์ประกอบของฟอร์ม การไปเลือกองค์ประกอบอื่นของฟอร์ม และการแก้ไขข้อมูลของฟอร์ม
                สำหรับอินพุตทุกตัวในฟอร์ม เราจะสามารถใช้ onfocus, onblur, และ onchange เพื่อดักจับว่าผู้ใช้ได้คลิกเลือกอินพุตนั้นของฟอร์ม   ไปคลิกเลือกตัวอื่น หรือมีการแก้ไขอินพุตของฟอร์ม 
การส่งข้อมูลจากฟอร์ม
                เมื่อมีการจะส่งข้อมูลจากฟอร์ม จะเกิดเหตุการณ์ onsubmit ซึ่งเราสามารถบรรจุการเซ็ตเหตุการณ์นี้ไว้ในแท็ก form ดังเช่น



&#60;form method=&#8221;post&#8221; action=&#8221;xxx.htm&#8221;
onsubmit=&#8221;return checkForm()&#8221;&#62;



    สำหรับการตอบสนองต่อเหตุการณ์ onsubmit ตัวนี้มีจุดน่าสนใจคือ   [...]]]></description>
			<content:encoded><![CDATA[<h2>เหตุการณ์มาตรฐานในจาวาสตริปต์ (จาก wc3schools.com)</h2>
<p>ในแต่ละแท็กที่ประกอบกันขึ้นด้วยภาษา HTML เพื่อใช้แสดงหน้าเว็บ   หลายๆ แท็กที่ปรากฏนั้นสามารถที่จะตอบสนองต่อเหตุการณ์ต่างๆ ที่เกิดขึ้นได้หลากหลาย ดังเช่น</p>
<p>- เมื่อหน้าเว็บโหลดเสร็จแล้ว หรือเมื่อกำลังจะเปลี่ยนหน้าเว็บไปยังหน้าอื่นหรือปิดหน้าต่าง</p>
<p>- เมื่อผู้ใช้คลิกเลือกหน้าต่างของเว็บบราวเซอร์ หรือเมื่อผู้ใช้คลิกเลือกหน้าต่างโปรแกรมตัวอื่นบนระบบปฏิบัติการ</p>
<p>- เมื่อผู้ใช้เลื่อนเมาส์ไปบนพื้นที่แสดงที่ควบคุมด้วยแท็กนั้นๆ และเมื่อผู้ใช้เลื่อนเมาส์ออกจากพื้นที่แสดง</p>
<p>- เมื่อผู้ใช้คลิกลงไปยังพื้นที่ที่ควบคุมด้วยแท็กนั้นๆ</p>
<p>- เมื่อผู้ใช้แก้ไขข้อมูลที่เป็นองค์ประกอบของฟอร์ม</p>
<p>- เมื่อผู้ใช้กดปุ่ม submit</p>
<p><span id="more-162"></span><br />
ในการจัดการต่อเหตุการณ์ต่างๆ เหล่านี้ เราสามารถกระทำได้โดยการอ้างชื่อเหตุการณ์ตามด้วย = และ คำสั่งจาวาสคริปต์ในเครื่องหมาย &#8220;&#8221;  ซึ่งคล้ายคลึงกับการกำหนดแอดตริบิวต์ภายในแท็กทั่วไปนั่นเอง    เหตุการณ์ที่สำคัญมีดังเช่น</p>
<h2> </h2>
<h2>การโหลดหน้าเว็บและการเปลี่ยน-ปิดเน้าเว็บ</h2>
<p>                เหตุการณ์ onload จะเกิดขึ้นเมื่อหน้าเว็บได้รับการอ่านและ parsing เรียบร้อยและได้รับการ render เสร็จสิ้น ส่วนเหตุการณ์ onunload จะเกิดขึ้นเมื่อผู้ใช้คลิกเลือกลิงค์เพื่อเปลี่ยนหน้าเว็บไปยังหน้าอื่น   ปิดหน้าต่างเว็บ หรือป้อน location ใหม่และกด enter เพื่อเปลี่ยนหน้าเว็บไปหน้าอื่น</p>
<p>                การเขียนโค้ดจาวาสคริปต์เพื่อจัดการต่อเหตุการณ์ทั้งสองนี้ จะบรรจุการกำหนดเหตุการณ์ไว้ที่แท็ก &lt;body&gt;</p>
<h2>การเลือกองค์ประกอบของฟอร์ม การไปเลือกองค์ประกอบอื่นของฟอร์ม และการแก้ไขข้อมูลของฟอร์ม</h2>
<p>                สำหรับอินพุตทุกตัวในฟอร์ม เราจะสามารถใช้ onfocus, onblur, และ onchange เพื่อดักจับว่าผู้ใช้ได้คลิกเลือกอินพุตนั้นของฟอร์ม   ไปคลิกเลือกตัวอื่น หรือมีการแก้ไขอินพุตของฟอร์ม </p>
<h2>การส่งข้อมูลจากฟอร์ม</h2>
<p><strong>                </strong>เมื่อมีการจะส่งข้อมูลจากฟอร์ม จะเกิดเหตุการณ์ onsubmit ซึ่งเราสามารถบรรจุการเซ็ตเหตุการณ์นี้ไว้ในแท็ก form ดังเช่น</p>
<table border="1" cellspacing="0" cellpadding="0" width="56%">
<tbody>
<tr>
<td width="100%">&lt;form method=&#8221;post&#8221; action=&#8221;xxx.htm&#8221;</p>
<p>onsubmit=&#8221;return checkForm()&#8221;&gt;</td>
</tr>
</tbody>
</table>
<p>    สำหรับการตอบสนองต่อเหตุการณ์ onsubmit ตัวนี้มีจุดน่าสนใจคือ   เราสามารถส่งค่ากลับไปยังการทำงานของเว็บบราวเซอร์ได้โดยการใช้ return ค่าทางตรรก (ture หรือ false) โดยถ้าค่าส่งกลับเป็นเท็จ จะไม่มีการกระทำการส่งฟอร์ม ดังนั้นเราสามารถเขียนฟังก์ชันตรวจสอบความถูกต้องของฟอร์มและใช้กับเหตุการณ์ onsubmit นี้ได้</p>
<h2>การลากเมาส์ไปบนองค์ประกอบ และการลางเมาส์ออกจากองค์ประกอบ</h2>
<p>                        สำหรับองค์ประกอบส่วนใหญ่ของหน้าเว็บ   เราสามารถใช้ onmouseover และ onmouseout เพื่อดักจับและตอบสนองต่อเหตุการณ์เมื่อเราลากเมาส์ไปบนพื้นที่หรือลากเมาส์ออกจากพื้นที่ได้</p>
<h2>สรุปเหตุการณ์ต่างๆ ที่มีในจาวาสคริปต์</h2>
<p>รายละเอียดต่อไปนี้คือเหตุการณ์มาตรฐานของ HTML DOM ที่จาวาสคริปต์สามารถเข้าไปจัดการได้ อนึ่ง แท็ก HTML แต่ละตัวจะรองรับเหตุการณ์ต่างๆ ได้ไม่เท่ากัน รายละเอียดจะได้กล่าวต่อไปในภายหลัง</p>
<p><strong>FF</strong>: Firefox, <strong>N</strong>: Netscape, <strong>IE</strong>: Internet Explorer</p>
<table border="1" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td width="20%" valign="top"><strong>Attribute</strong><strong></strong></td>
<td width="68%" valign="top"><strong>The event occurs when&#8230;</strong><strong></strong></td>
<td width="4%" valign="top"><strong>FF</strong><strong></strong></td>
<td width="4%" valign="top"><strong>N</strong><strong></strong></td>
<td width="4%" valign="top"><strong>IE</strong><strong></strong></td>
</tr>
<tr>
<td valign="top"><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_onabort.html" target="_blank">onabort</a></td>
<td valign="top">Loading of an image is interrupted</td>
<td valign="top">1</td>
<td valign="top">3</td>
<td valign="top">4</td>
</tr>
<tr>
<td valign="top"><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_onblur.html" target="_blank">onblur</a></td>
<td valign="top">An element loses focus</td>
<td valign="top">1</td>
<td valign="top">2</td>
<td valign="top">3</td>
</tr>
<tr>
<td valign="top"><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_onchange.html" target="_blank">onchange</a></td>
<td valign="top">The content of a field changes</td>
<td valign="top">1</td>
<td valign="top">2</td>
<td valign="top">3</td>
</tr>
<tr>
<td valign="top"><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_onclick.html" target="_blank">onclick</a></td>
<td valign="top">Mouse clicks an object</td>
<td valign="top">1</td>
<td valign="top">2</td>
<td valign="top">3</td>
</tr>
<tr>
<td valign="top"><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_ondblclick.html" target="_blank">ondblclick</a></td>
<td valign="top">Mouse double-clicks an object</td>
<td valign="top">1</td>
<td valign="top">4</td>
<td valign="top">4</td>
</tr>
<tr>
<td valign="top"><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_onerror.html" target="_blank">onerror</a></td>
<td valign="top">An error occurs when loading a document or an image</td>
<td valign="top">1</td>
<td valign="top">3</td>
<td valign="top">4</td>
</tr>
<tr>
<td valign="top"><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_onfocus.html" target="_blank">onfocus</a></td>
<td valign="top">An element gets focus</td>
<td valign="top">1</td>
<td valign="top">2</td>
<td valign="top">3</td>
</tr>
<tr>
<td valign="top"><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_onkeydown.html" target="_blank">onkeydown</a></td>
<td valign="top">A keyboard key is pressed</td>
<td valign="top">1</td>
<td valign="top">4</td>
<td valign="top">3</td>
</tr>
<tr>
<td valign="top"><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_onkeypress.html" target="_blank">onkeypress</a></td>
<td valign="top">A keyboard key is pressed or held down</td>
<td valign="top">1</td>
<td valign="top">4</td>
<td valign="top">3</td>
</tr>
<tr>
<td valign="top"><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_onkeyup.html" target="_blank">onkeyup</a></td>
<td valign="top">A keyboard key is released</td>
<td valign="top">1</td>
<td valign="top">4</td>
<td valign="top">3</td>
</tr>
<tr>
<td valign="top"><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_onload.html" target="_blank">onload</a></td>
<td valign="top">A page or an image is finished loading</td>
<td valign="top">1</td>
<td valign="top">2</td>
<td valign="top">3</td>
</tr>
<tr>
<td valign="top"><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_onmousedown.html" target="_blank">onmousedown</a></td>
<td valign="top">A mouse button is pressed</td>
<td valign="top">1</td>
<td valign="top">4</td>
<td valign="top">4</td>
</tr>
<tr>
<td valign="top"><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_onmousemove.html">onmousemove</a></td>
<td valign="top">The mouse is moved</td>
<td valign="top">1</td>
<td valign="top">6</td>
<td valign="top">3</td>
</tr>
<tr>
<td valign="top"><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_onmouseout.html" target="_blank">onmouseout</a></td>
<td valign="top">The mouse is moved off an element</td>
<td valign="top">1</td>
<td valign="top">4</td>
<td valign="top">4</td>
</tr>
<tr>
<td valign="top"><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_onmouseover.html" target="_blank">onmouseover</a></td>
<td valign="top">The mouse is moved over an element</td>
<td valign="top">1</td>
<td valign="top">2</td>
<td valign="top">3</td>
</tr>
<tr>
<td valign="top"><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_onmouseup.html" target="_blank">onmouseup</a></td>
<td valign="top">A mouse button is released</td>
<td valign="top">1</td>
<td valign="top">4</td>
<td valign="top">4</td>
</tr>
<tr>
<td valign="top"><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_onreset.html" target="_blank">onreset</a></td>
<td valign="top">The reset button is clicked</td>
<td valign="top">1</td>
<td valign="top">3</td>
<td valign="top">4</td>
</tr>
<tr>
<td valign="top"><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_onresize.html" target="_blank">onresize</a></td>
<td valign="top">A window or frame is resized</td>
<td valign="top">1</td>
<td valign="top">4</td>
<td valign="top">4</td>
</tr>
<tr>
<td valign="top"><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_onselect.html" target="_blank">onselect</a></td>
<td valign="top">Text is selected</td>
<td valign="top">1</td>
<td valign="top">2</td>
<td valign="top">3</td>
</tr>
<tr>
<td valign="top"><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_onsubmit.html" target="_blank">onsubmit</a></td>
<td valign="top">The submit button is clicked</td>
<td valign="top">1</td>
<td valign="top">2</td>
<td valign="top">3</td>
</tr>
<tr>
<td valign="top"><a href="http://www.w3schools.com_jsref_default.asp/www.w3schools.com/jsref/jsref_onunload.html" target="_blank">onunload</a></td>
<td valign="top">The user exits the page</td>
<td valign="top">1</td>
<td valign="top">2</td>
<td valign="top">3</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://devzonedd.homeip.net/?feed=rss2&amp;p=162</wfw:commentRss>
		</item>
		<item>
		<title>การจัดการความผิดพลาด (Exception Handling)</title>
		<link>http://devzonedd.homeip.net/?p=159</link>
		<comments>http://devzonedd.homeip.net/?p=159#comments</comments>
		<pubDate>Mon, 16 Mar 2009 04:33:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://devzonedd.homeip.net/?p=159</guid>
		<description><![CDATA[การจัดการความผิดพลาด (Exception Handling)
                คุณสมบัติหนึ่งที่ภาษาโปรแกรมเชิงวัตถุมีก็คือ   กระบวนการดักจับและจัดการต่อความผิดพลาดที่เกิดจึ้น จาวาสคริปต์เองก็มีคุณลักษณะนี้โดยใช้กลไกการ try-catch เช่นเดียวกับภาษาโปรแกรมเชิงวัตถุตัวอื่น  เพียงแต่ไม่ได้มีครบถ้วนดังเช่นภาษาเชิงวัตถุบางตัวอย่าง C++ หรือภาษาจาวา เป็นต้น
                การดักจับความผิดพลาดในจาวาสคริปต์   มีวิธีอยู่สองวิธี สำหรับวิธีที่ถูกนำมาใช้กันมากในปัจจุบันคือการใช้ try-catch ซึ่งมีรูปประโยคดังนี้



try
{
//Run some code here
}
catch(err)
{
//Handle errors here
}




    ในการเขียนโค้ดภาษาจาวาสคริปต์นั้น   หากเราต้องการที่จะดักจับความผิดพลาดใดๆ ที่เกิดขึ้นระหว่างการประมวลโค้ดที่อยู่นอกฟังก์ชัน หรือโค้ดที่อยู่ในฟังก์ชัน (ภายใต้เครื่องหมาย { } ) เราสามารถกระทำโดยการใช้คำสั่ง try{} ล้อมบริเวณดังกล่าวไว้ ทั้งนี้เนื่องจากเครื่องหมาย { } ถูกนำไปใช้ในการนิยามฟังก์ชันหรือกลุ่มคำสั่งด้วย ดังนั้นเราจะไม่สามรารถล้อมบริเวณที่คาบเกี่ยวระหว่างนอกฟังก์ชันกับในฟังก์ชัน หรือข้ามส่วนบริเวณที่ล้อมรอบเป็นกลุ่มคำสั่งได้ (ต้องล้อมบริเวณนอกฟังก์ชัน หรือภายในบริเวณต่างๆ ในฟังก์ชันโดยจะต้องล้อมกรอบคร่อมชุดกลุ่มคำสั่งทั้งชุดไว้
                เมื่อเกิดความผิดพลาดขึ้นในระหว่างการทำงานตามคำสั่งในบริเวณ try{} ดังกล่าว โปรแกรมจะกระโดดมาทำงานภายใน catch(){} โดยข้อมูลบ่งความผิดพลาดจะส่งมาเก็บไว้ที่ตัวแปรในวงเล็บหลังคำสงวน catch
                ลองดูตัวอย่างต่อไปนี้ และลองรันโค้ดดูว่า เกิดอะไรขึ้น



&#60;html&#62;
&#60;head&#62;
&#60;script type=&#8221;text/javascript&#8221;&#62;
var txt=&#8221;"
function message()
{
try
 {
 adddlert(&#8221;Welcome guest!&#8221;)
 }
catch(err)
 {
 txt=&#8221;There was an error on this page.\n\n&#8221;
 txt+=&#8221;Error description: &#8221; + [...]]]></description>
			<content:encoded><![CDATA[<h2>การจัดการความผิดพลาด (Exception Handling)</h2>
<p>                คุณสมบัติหนึ่งที่ภาษาโปรแกรมเชิงวัตถุมีก็คือ   กระบวนการดักจับและจัดการต่อความผิดพลาดที่เกิดจึ้น จาวาสคริปต์เองก็มีคุณลักษณะนี้โดยใช้กลไกการ try-catch เช่นเดียวกับภาษาโปรแกรมเชิงวัตถุตัวอื่น  เพียงแต่ไม่ได้มีครบถ้วนดังเช่นภาษาเชิงวัตถุบางตัวอย่าง C++ หรือภาษาจาวา เป็นต้น</p>
<p>                การดักจับความผิดพลาดในจาวาสคริปต์   มีวิธีอยู่สองวิธี สำหรับวิธีที่ถูกนำมาใช้กันมากในปัจจุบันคือการใช้ try-catch ซึ่งมีรูปประโยคดังนี้</p>
<table border="1" cellspacing="0" cellpadding="0" width="29%">
<tbody>
<tr>
<td width="100%">try</p>
<p>{</p>
<p>//Run some code here</p>
<p>}</p>
<p>catch(err)</p>
<p>{</p>
<p>//Handle errors here</p>
<p>}</td>
</tr>
</tbody>
</table>
<p><span id="more-159"></span><br />
    ในการเขียนโค้ดภาษาจาวาสคริปต์นั้น   หากเราต้องการที่จะดักจับความผิดพลาดใดๆ ที่เกิดขึ้นระหว่างการประมวลโค้ดที่อยู่นอกฟังก์ชัน หรือโค้ดที่อยู่ในฟังก์ชัน (ภายใต้เครื่องหมาย { } ) เราสามารถกระทำโดยการใช้คำสั่ง try{} ล้อมบริเวณดังกล่าวไว้ ทั้งนี้เนื่องจากเครื่องหมาย { } ถูกนำไปใช้ในการนิยามฟังก์ชันหรือกลุ่มคำสั่งด้วย ดังนั้นเราจะไม่สามรารถล้อมบริเวณที่คาบเกี่ยวระหว่างนอกฟังก์ชันกับในฟังก์ชัน หรือข้ามส่วนบริเวณที่ล้อมรอบเป็นกลุ่มคำสั่งได้ (ต้องล้อมบริเวณนอกฟังก์ชัน หรือภายในบริเวณต่างๆ ในฟังก์ชันโดยจะต้องล้อมกรอบคร่อมชุดกลุ่มคำสั่งทั้งชุดไว้</p>
<p>                เมื่อเกิดความผิดพลาดขึ้นในระหว่างการทำงานตามคำสั่งในบริเวณ try{} ดังกล่าว โปรแกรมจะกระโดดมาทำงานภายใน catch(){} โดยข้อมูลบ่งความผิดพลาดจะส่งมาเก็บไว้ที่ตัวแปรในวงเล็บหลังคำสงวน catch</p>
<p>                ลองดูตัวอย่างต่อไปนี้ และลองรันโค้ดดูว่า เกิดอะไรขึ้น</p>
<table border="1" cellspacing="0" cellpadding="0" width="86%">
<tbody>
<tr>
<td width="100%">&lt;html&gt;</p>
<p>&lt;head&gt;</p>
<p>&lt;script type=&#8221;text/javascript&#8221;&gt;</p>
<p>var txt=&#8221;"</p>
<p>function message()</p>
<p>{</p>
<p>try</p>
<p> {</p>
<p> adddlert(&#8221;Welcome guest!&#8221;)</p>
<p> }</p>
<p>catch(err)</p>
<p> {</p>
<p> txt=&#8221;There was an error on this page.\n\n&#8221;</p>
<p> txt+=&#8221;Error description: &#8221; + err.description + &#8220;\n\n&#8221;</p>
<p> txt+=&#8221;Click OK to continue.\n\n&#8221;</p>
<p> alert(txt)</p>
<p> }</p>
<p>}</p>
<p>&lt;/script&gt;</p>
<p>&lt;/head&gt;</p>
<p> </p>
<p>&lt;body&gt;</p>
<p>&lt;input type=&#8221;button&#8221; value=&#8221;View message&#8221; onclick=&#8221;message()&#8221; /&gt;</p>
<p>&lt;/body&gt;</p>
<p> </p>
<p>&lt;/html&gt;</td>
</tr>
</tbody>
</table>
<p>    ในบางกรณีที่เราสามารถคาดการณ์ได้ว่า อาจจะเกิดการทำงานที่ผิดพลาดในทางใดได้บ้าง   แทนที่เราจะเขียนโปรแกรมในเชิงดักจับเพียงอย่างเดียว เราอาจจะเขียนโค้ดให้มีการสร้างสัญญาณเหตุการณ์ความผิดพลาดขึ้นเองด้วยก็ได้ และโดยการสร้างเหตุการณ์บอกความผิดพลาดนี้ ทำให้เราสามารถแนบข้อความบอกประเภทความผิดพลาดเป็นการเฉพาะไปด้วยได้   โดยในส่วนการทำงานตอบสนองต่อความผิดพลาดใน catch(){} นั้น เราจึงสามารถนำข้อมูลรายงานความผิดพลาดมาตรวจสอบและตอบสนองเป็นการเฉพาะต่อสัญญาณความผิดพลาดนั้นๆ ได้</p>
<p>                การสร้างสัญญาณบอกความผิดพลาด เรากระทำโดยใช้คำสงวน throw ดังตัวอย่าง</p>
<table border="1" cellspacing="0" cellpadding="0" width="68%">
<tbody>
<tr>
<td width="100%">&lt;html&gt;</p>
<p>&lt;body&gt;</p>
<p>&lt;script type=&#8221;text/javascript&#8221;&gt;</p>
<p>var x=prompt(&#8221;Enter a number between 0 and 10:&#8221;,&#8221;")</p>
<p>try</p>
<p>{</p>
<p>if(x&gt;10)</p>
<p>throw &#8220;Err1&#8243;</p>
<p>else if(x&lt;0)</p>
<p>throw &#8220;Err2&#8243;</p>
<p>}</p>
<p>catch(er)</p>
<p>{</p>
<p>if(er==&#8221;Err1&#8243;)</p>
<p>alert(&#8221;Error! The value is too high&#8221;)</p>
<p>if(er==&#8221;Err2&#8243;)</p>
<p>alert(&#8221;Error! The value is too low&#8221;)</p>
<p>}</p>
<p>&lt;/script&gt;</p>
<p>&lt;/body&gt;</p>
<p>&lt;/html&gt;</td>
</tr>
</tbody>
</table>
<p>    จะเห็นได้ว่า ในกรณีนี้เราสร้างสัญญาณความผิดพลาดโดยกำกับข้อมูลเป็น &#8220;Err1&#8243; หรือ &#8220;Err2&#8243; ขึ้นอยู่กับสถานะที่เราต้องการ   และในส่วนของ catch(){}  จะเห็นว่าตัวแปร er ที่รับข้อมูลแสดงความผิดพลาด จะเก็บค่าที่เราโยน (throw) สัญญาณความผิดพลาดนี้ ซึ่งเราสามารถตรวจสอบค่าใน er เพื่อตอบสนองต่อความผิดพลาดเป็นการเฉพาะกรณีได้</p>
<p>                 สำหรับเว็บบราวเซอร์เก่าๆ หน่อย จะไม่รองรับ try-catch นี้ แต่จะรองรับการดักจับความผิดพลาดโดยผ่านทางเหตุการณ์ onerror (เว็บบราวเซอร์เวอร์ชันที่นิยมใช้กันในปัจจุบันจะรองรับทั้งสองแบบ) ซึ่งในการใช้งานแบบนี้ เราจะสร้างฟังก์ชันขึ้นมาเพื่อรองรับในกรณีที่เกิดความผิดพลาดขึ้นในระหว่างการประมวลของจาวาสคริปต์    ดังตัวอย่าง</p>
<table border="1" cellspacing="0" cellpadding="0" width="41%">
<tbody>
<tr>
<td width="100%">onerror=handleErr</p>
<p>function handleErr(msg,url,l)</p>
<p>{</p>
<p>//Handle the error here</p>
<p>return true or false</p>
<p>}</td>
</tr>
</tbody>
</table>
<p>    พารามิเตอร์สำหรับฟังก์ชันที่ใช้ตอบสนองต่อเหตุการณ์ onerror มีสามตัว   ตัวแรก msg จะรับข้อมูลแสดงความผิดพลาดที่เกิดขึ้น ตัวที่สอง url เป็น location ของหน้าเว็ปปัจจุบันที่เกิดปัญหาขึ้น และ l คือบรรทัดที่เกิดความผิดพลาดในการทำงาน ค่าส่งกลับเป็น boolean ซึ่งอาจเป็น true หรือ false โดยถ้าส่งค่ากลับเป็น true เว็บบราวเซอร์จะไม่มีการแสดงข้อความผิดพลาดใดๆ แต่ถ้าเป็น false จะมีการรายงานความผิดพลาดแสดงไว้ที่ Javascript Console ของบราวเซอร์นั้นๆ ไว้ด้วย</p>
<p>    ให้นักศึกษาลองศึกษาจากตัวอย่างการใช้งานต่อไปนี้</p>
<table border="1" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>&lt;html&gt;</p>
<p>&lt;head&gt;</p>
<p>&lt;script type=&#8221;text/javascript&#8221;&gt;</p>
<p>onerror=handleErr</p>
<p>var txt=&#8221;"</p>
<p>function handleErr(msg,url,l)</p>
<p>{</p>
<p>txt=&#8221;There was an error on this page.\n\n&#8221;</p>
<p>txt+=&#8221;Error: &#8221; + msg + &#8220;\n&#8221;</p>
<p>txt+=&#8221;URL: &#8221; + url + &#8220;\n&#8221;</p>
<p>txt+=&#8221;Line: &#8221; + l + &#8220;\n\n&#8221;</p>
<p>txt+=&#8221;Click OK to continue.\n\n&#8221;</p>
<p>alert(txt)</p>
<p>return true</p>
<p>}</p>
<p>function message()</p>
<p>{</p>
<p>adddlert(&#8221;Welcome guest!&#8221;)</p>
<p>}</p>
<p>&lt;/script&gt;</p>
<p>&lt;/head&gt;</p>
<p>&lt;body&gt;</p>
<p>&lt;input type=&#8221;button&#8221; value=&#8221;View message&#8221; onclick=&#8221;message()&#8221; /&gt;</p>
<p>&lt;/body&gt;</p>
<p>&lt;/html&gt;</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://devzonedd.homeip.net/?feed=rss2&amp;p=159</wfw:commentRss>
		</item>
		<item>
		<title>Javascript กับการจัดการตัวแปร Array</title>
		<link>http://devzonedd.homeip.net/?p=157</link>
		<comments>http://devzonedd.homeip.net/?p=157#comments</comments>
		<pubDate>Mon, 16 Mar 2009 04:31:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://devzonedd.homeip.net/?p=157</guid>
		<description><![CDATA[อาร์เรย์
                อาร์เรย์ในภาษาจาวาสคริปต์ แท้ที่จริงแล้วก็คืออ็อปเจ็คต์ชนิดหนึ่ง  
                การนิยามอาร์เรย์เริ่มต้น เราจะสร้างตัวแปรอาร์เรย์โดยสืบทอดมาจากอ็อปเจ็คต์ Array()





var myArray = new Array()




 





var myArray = new Array()
myArray[0] = &#8220;This&#8221;
myArray[1] = &#8220;is&#8221;




                การนำข้อมูลเข้าในอาร์เรย์   ใช้การอ้างอินเด็กซ์เพื่อนำค่าเข้า เช่น

                เราอาจจะกำหนดจำนวนสมาชิกในอาร์เรย์โดยการใส่ค่าพารามิเตอร์ที่อ็อปเจ็คต์ต้นแบบเช่น





var myArray = new Array(2)
myArray[0] = &#8220;This&#8221;
myArray[1] = &#8220;is&#8221;




                หรือเราจะผ่านสมาชิกของอาร์เรย์เป็นพารามิเตอร์เริ่มต้นก็ได้เช่นกัน





var myArray = new Array(&#8221;This&#8221;,&#8221;is&#8221;)




                ในการอ่านข้อมูลในอาร์เรย์ เราอ้างชื่ออาร์เรย์และตามด้วยอินเด็กซ์ เช่น





document.write(myArray[0])




คำสั่งวนรอบ For&#8230;In
                จาวาสคริปต์มีคำสั่ง For&#8230;In สำหรับใช้อ่านสมาชิกของออปเจ็คต์ไล่ไปทีละตัวจนครบ โดยคำสั่งวนรอบจะทำการอ่านค่ามาทีละสมาชิก นำไปเก็บไว้ในตัวแปรชั่วคราว คำสั่งในวนรอบจึงสามารถใช้ค่าในตัวแปรนำไปใช้งานได้ตามชอบ
                รูปทั่วไปของ For&#8230;In มีดังนี้คือ



for (variable in object)
{
    code to be executed
}



                ดังตัวอย่าง





var myArray = new Array(2)
myArray[0] = &#8220;This&#8221;
myArray[1] [...]]]></description>
			<content:encoded><![CDATA[<h2>อาร์เรย์</h2>
<p>                อาร์เรย์ในภาษาจาวาสคริปต์ แท้ที่จริงแล้วก็คืออ็อปเจ็คต์ชนิดหนึ่ง  </p>
<p>                การนิยามอาร์เรย์เริ่มต้น เราจะสร้างตัวแปรอาร์เรย์โดยสืบทอดมาจากอ็อปเจ็คต์ Array()</p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>
<div>
<p>var myArray = new Array()</p></div>
</td>
</tr>
</tbody>
</table>
<p> </p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>
<div>
<p>var myArray = new Array()</p>
<p>myArray[0] = &#8220;This&#8221;</p>
<p>myArray[1] = &#8220;is&#8221;</p></div>
</td>
</tr>
</tbody>
</table>
<p>                การนำข้อมูลเข้าในอาร์เรย์   ใช้การอ้างอินเด็กซ์เพื่อนำค่าเข้า เช่น</p>
<p><span id="more-157"></span><br />
                เราอาจจะกำหนดจำนวนสมาชิกในอาร์เรย์โดยการใส่ค่าพารามิเตอร์ที่อ็อปเจ็คต์ต้นแบบเช่น</p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>
<div>
<p>var myArray = new Array(2)</p>
<p>myArray[0] = &#8220;This&#8221;</p>
<p>myArray[1] = &#8220;is&#8221;</p></div>
</td>
</tr>
</tbody>
</table>
<p>                หรือเราจะผ่านสมาชิกของอาร์เรย์เป็นพารามิเตอร์เริ่มต้นก็ได้เช่นกัน</p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>
<div>
<p>var myArray = new Array(&#8221;This&#8221;,&#8221;is&#8221;)</p></div>
</td>
</tr>
</tbody>
</table>
<p>                ในการอ่านข้อมูลในอาร์เรย์ เราอ้างชื่ออาร์เรย์และตามด้วยอินเด็กซ์ เช่น</p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>
<div>
<p>document.write(myArray[0])</p></div>
</td>
</tr>
</tbody>
</table>
<p><strong>คำสั่งวนรอบ </strong><strong>For&#8230;In</strong></p>
<p>                จาวาสคริปต์มีคำสั่ง For&#8230;In สำหรับใช้อ่านสมาชิกของออปเจ็คต์ไล่ไปทีละตัวจนครบ โดยคำสั่งวนรอบจะทำการอ่านค่ามาทีละสมาชิก นำไปเก็บไว้ในตัวแปรชั่วคราว คำสั่งในวนรอบจึงสามารถใช้ค่าในตัวแปรนำไปใช้งานได้ตามชอบ</p>
<p>                รูปทั่วไปของ For&#8230;In มีดังนี้คือ</p>
<table border="1" cellspacing="0" cellpadding="0" width="54%">
<tbody>
<tr>
<td width="100%">for (variable in object)</p>
<p>{</p>
<p>    code to be executed</p>
<p>}</td>
</tr>
</tbody>
</table>
<p>                ดังตัวอย่าง</p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>
<div>
<p>var myArray = new Array(2)</p>
<p>myArray[0] = &#8220;This&#8221;</p>
<p>myArray[1] = &#8220;is&#8221;</p>
<p> </p>
<p>for(aWord in myArray){</p>
<p>   document.write(aWord+&#8217;&lt;br&gt;&#8217;)</p>
<p>}</p></div>
</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://devzonedd.homeip.net/?feed=rss2&amp;p=157</wfw:commentRss>
		</item>
	</channel>
</rss>
