<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5958718683792590789</id><updated>2012-01-26T22:33:13.335-08:00</updated><category term='web crawler'/><category term='gemette'/><category term='DOM'/><category term='socket'/><category term='file'/><category term='Javascript'/><category term='php'/><category term='ajax'/><category term='database'/><category term='example'/><category term='perl'/><title type='text'>Script Diaries</title><subtitle type='html'>Scripting tutorials, examples and snippets. javascript, web 2, ajax, php, perl. Learn how to create exciting widgets widgets using yahoo, google and wtitter apis and DOM. Harness the power of web 2.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://scriptdiaries.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://scriptdiaries.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>righteous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_tqP4IzwKwvc/SlFHxeKbpnI/AAAAAAAAAw4/-CCuJO61cyM/S220/righteousninja.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>29</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5958718683792590789.post-2739214225064050711</id><published>2010-11-05T01:13:00.000-07:00</published><updated>2009-11-06T03:22:48.086-08:00</updated><title type='text'>Welcome to Script Diaries</title><content type='html'>&lt;style  TYPE="text/css"&gt;.getposts_href{ font-family:arial; font-size:10px; color:black; font-weight:bold}.getposts_summary{ font-family:arial; font-size:9px; color:black;}.getposts_search{ font-family:arial; font-size:14px; color:#000000; font-weignt:bold} &lt;/style&gt;&lt;br /&gt;&lt;table width="80%"&gt;&lt;tr&gt;&lt;td&gt;Welcome to the one place where you can probably find any kind of web 2, javascript, php or perl tutorial. From dynamic html to cascading style sheets to AJAX techniques. We have it all.&lt;/td&gt;&lt;td width="20px"&gt;&lt;/td&gt;&lt;td&gt;Learn how to create rich and interactive widgets using the latest APIs and web 2 technology. &lt;a href="http://scriptdiaries.blogspot.com/2009/10/welcome-to-do-it-yourself-widgets.html"&gt;Easy DIY widgets &lt;/a&gt;you can do it yourself and learn javascript at the same time&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;table width="10%" cellpadding="5" cellspacing="0" border="0" width="100%"&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;    &lt;table width="230"  style="background-color:#FFCCCC" cellpadding="0" cellspacing="0"&gt;  &lt;tr height="15px"&gt;   &lt;td width="15px" background="http://codediaries.com/common/edge1.gif"&gt;&lt;/td&gt;&lt;td width="200px"&gt;&lt;/td&gt;&lt;td width="15px" background="http://codediaries.com/common/edge2.gif"&gt;&lt;/td&gt;  &lt;/tr&gt;        &lt;tr&gt;&lt;td colspan="3"&gt;&lt;br /&gt;   &lt;table&gt;&lt;tr&gt;&lt;td style="padding:5"&gt;&lt;div id="mypostslot0"&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;   &lt;tr&gt;&lt;td height="15px"&gt;&lt;/td&gt;&lt;/tr&gt;   &lt;tr&gt;&lt;td style="padding:5"&gt;&lt;div id="mypostslot1"&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;        &lt;/td&gt;&lt;/tr&gt;        &lt;tr height="15px"&gt;   &lt;td width="15px" background="http://codediaries.com/common/edge4.gif"&gt;&lt;/td&gt;&lt;td width="200px"&gt;&lt;/td&gt;&lt;td width="15px" background="http://codediaries.com/common/edge3.gif"&gt;&lt;/td&gt;  &lt;/tr&gt;    &lt;/table&gt;&lt;/td&gt;&lt;td&gt;&lt;br /&gt;    &lt;table width="230"  style="background-color:#FFCC99" cellpadding="0" cellspacing="0"&gt;  &lt;tr height="15px"&gt;   &lt;td width="15px" background="http://codediaries.com/common/edge1.gif"&gt;&lt;/td&gt;&lt;td width="200px"&gt;&lt;/td&gt;&lt;td width="15px" background="http://codediaries.com/common/edge2.gif"&gt;&lt;/td&gt;  &lt;/tr&gt;        &lt;tr&gt;&lt;td colspan="3"&gt;&lt;br /&gt;   &lt;table&gt;&lt;tr&gt;&lt;td style="padding:5"&gt;&lt;div id="mypostslot2"&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;   &lt;tr&gt;&lt;td height="15px"&gt;&lt;/td&gt;&lt;/tr&gt;   &lt;tr&gt;&lt;td style="padding:5"&gt;&lt;div id="mypostslot3"&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;        &lt;/td&gt;&lt;/tr&gt;        &lt;tr height="15px"&gt;   &lt;td width="15px" background="http://codediaries.com/common/edge4.gif"&gt;&lt;/td&gt;&lt;td width="200px"&gt;&lt;/td&gt;&lt;td width="15px" background="http://codediaries.com/common/edge3.gif"&gt;&lt;/td&gt;  &lt;/tr&gt;    &lt;/table&gt;&lt;/td&gt;&lt;td&gt;&lt;br /&gt;    &lt;table width="230"  style="background-color:#FFFF99" cellpadding="0" cellspacing="0"&gt;  &lt;tr height="15px"&gt;   &lt;td width="15px" background="http://codediaries.com/common/edge1.gif"&gt;&lt;/td&gt;&lt;td width="200px"&gt;&lt;/td&gt;&lt;td width="15px" background="http://codediaries.com/common/edge2.gif"&gt;&lt;/td&gt;  &lt;/tr&gt;        &lt;tr&gt;&lt;td colspan="3"&gt;&lt;br /&gt;   &lt;table&gt;&lt;tr&gt;&lt;td style="padding:5"&gt;&lt;center&gt;&lt;a href="http://scriptdiaries.blogspot.com/2009/10/welcome-to-do-it-yourself-widgets.html"&gt;&lt;img height="100px" src="http://4.bp.blogspot.com/_tqP4IzwKwvc/SvQBjmpv-HI/AAAAAAAAA-0/qyK-hr3jFZY/s200/Beaker_muppet.jpg"/&gt;&lt;br /&gt;            &lt;b&gt;DIY Widgets&lt;/b&gt;&lt;br /&gt;            Learn to design and create amazing widgets&lt;/a&gt;&lt;/center&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;        &lt;/td&gt;&lt;/tr&gt;        &lt;tr height="15px"&gt;   &lt;td width="15px" background="http://codediaries.com/common/edge4.gif"&gt;&lt;/td&gt;&lt;td width="200px"&gt;&lt;/td&gt;&lt;td width="15px" background="http://codediaries.com/common/edge3.gif"&gt;&lt;/td&gt;  &lt;/tr&gt;    &lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan="3"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;span class="getposts_search"&gt;Search Script Diaries and sister sites &lt;img style="vertical-align:middle" src="http://www.google.com/images/poweredby_transparent/poweredby_FFFFFF.gif" alt="Google" /&gt;&lt;/span&gt;&lt;form action="http://www.google.com/cse" id="cse-search-box" target="_blank"&gt;&lt;input type="hidden" name="cx" value="partner-pub-8627971548163634:t45noty6q6y" /&gt;&lt;input type="hidden" name="ie" value="ISO-8859-1" /&gt;&lt;input type="text" name="q" size="40" /&gt;&lt;input type="submit" name="sa" value="Search" /&gt;&lt;br /&gt;&lt;/form&gt;&lt;script type="text/javascript" src="http://www.google.com/jsapi"&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript" src="http://codediaries.com/widgets/getposts/wid_getposts.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;script&gt;GetPostsW_setupWidget( "5958718683792590789",               new Array("7847309396933386486",                        "1081388099548192639",                        "1587082141855385078",                        "7469192081158786194"),            "mypostslot");&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5958718683792590789-2739214225064050711?l=scriptdiaries.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scriptdiaries.blogspot.com/feeds/2739214225064050711/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5958718683792590789&amp;postID=2739214225064050711&amp;isPopup=true' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/2739214225064050711'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/2739214225064050711'/><link rel='alternate' type='text/html' href='http://scriptdiaries.blogspot.com/2009/11/welcome-to-script-diaries.html' title='Welcome to Script Diaries'/><author><name>righteous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_tqP4IzwKwvc/SlFHxeKbpnI/AAAAAAAAAw4/-CCuJO61cyM/S220/righteousninja.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_tqP4IzwKwvc/SvQBjmpv-HI/AAAAAAAAA-0/qyK-hr3jFZY/s72-c/Beaker_muppet.jpg' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5958718683792590789.post-2336382056859093859</id><published>2009-12-20T15:27:00.000-08:00</published><updated>2009-12-20T15:27:14.817-08:00</updated><title type='text'>Articles Moving Back to Code Diaries</title><content type='html'>Hi All,&lt;br /&gt;&lt;br /&gt;In the name of offering a more consistent service, all the articles under scriptdiaries.blogspot.com are now moving back to the main site &lt;a href="http://codediaries.blogspot.com/"&gt;codediaries.blogspot.com&lt;/a&gt;. This is to make it easier to maintain as I don't have the time to administer too many sites. While most articles have moved over. Some will take a little longer as I will edit them and make them better before I add them to code diaries.&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;Righteous.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5958718683792590789-2336382056859093859?l=scriptdiaries.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scriptdiaries.blogspot.com/feeds/2336382056859093859/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5958718683792590789&amp;postID=2336382056859093859&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/2336382056859093859'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/2336382056859093859'/><link rel='alternate' type='text/html' href='http://scriptdiaries.blogspot.com/2009/12/articles-moving-back-to-code-diaries.html' title='Articles Moving Back to Code Diaries'/><author><name>righteous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_tqP4IzwKwvc/SlFHxeKbpnI/AAAAAAAAAw4/-CCuJO61cyM/S220/righteousninja.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5958718683792590789.post-1322607965514142983</id><published>2009-11-05T18:21:00.000-08:00</published><updated>2009-12-20T15:21:45.810-08:00</updated><title type='text'>Lesson 4 - Advanced Twitter Widget Using Multiple Calls</title><content type='html'>This tutorial has moved back to Code Diaries.&lt;br /&gt;&lt;br /&gt;You can view it there at &lt;a href="http://codediaries.blogspot.com/2009/12/funky-twitter-thoughts-widgets-using.html"&gt;Funky Twitter Thoughts Widget Using Yahoo and Twitter JSON APIs&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5958718683792590789-1322607965514142983?l=scriptdiaries.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scriptdiaries.blogspot.com/feeds/1322607965514142983/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5958718683792590789&amp;postID=1322607965514142983&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/1322607965514142983'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/1322607965514142983'/><link rel='alternate' type='text/html' href='http://scriptdiaries.blogspot.com/2009/11/lesson-4-advanced-twitter-widget-using.html' title='Lesson 4 - Advanced Twitter Widget Using Multiple Calls'/><author><name>righteous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_tqP4IzwKwvc/SlFHxeKbpnI/AAAAAAAAAw4/-CCuJO61cyM/S220/righteousninja.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5958718683792590789.post-2166549967804445715</id><published>2009-11-05T18:17:00.000-08:00</published><updated>2009-11-05T20:02:21.502-08:00</updated><title type='text'>Lesson 3 - Search Widget that Displays Images and Related Keywords</title><content type='html'>&lt;span style="font-size: large;"&gt;&lt;strong&gt;Summary&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;This is lesson&amp;nbsp;3 of 4. In this lesson we will use Yahoo's image search API to display images in a circle. We will then use Yahoo's "context" API to extract relevant keywords. This widget makes two seperate calles to the Yahoo API. This is done by loading itself into an "iframe" and then using the "parent" object like parent.callAFunction() to deliver the results.&amp;nbsp;&lt;a href="http://scriptdiaries.blogspot.com/2009/10/welcome-to-do-it-yourself-widgets.html"&gt;Back to the Lesson Index&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size: large;"&gt;Explanation&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;First let us have a quick look at the code.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://codediaries.com/script/examples/widget_lessons.zip"&gt;&lt;img src="http://codediaries.com/code/ico_download.gif" style="height: 40px; vertical-align: middle;" /&gt;You can download a zipped version of all the lessons here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://scriptdiaries.blogspot.com/2009/10/welcome-to-do-it-yourself-widgets.html"&gt;Back to the Lesson Index&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5958718683792590789-2166549967804445715?l=scriptdiaries.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scriptdiaries.blogspot.com/feeds/2166549967804445715/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5958718683792590789&amp;postID=2166549967804445715&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/2166549967804445715'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/2166549967804445715'/><link rel='alternate' type='text/html' href='http://scriptdiaries.blogspot.com/2009/11/lesson-3-search-widget-that-displays.html' title='Lesson 3 - Search Widget that Displays Images and Related Keywords'/><author><name>righteous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_tqP4IzwKwvc/SlFHxeKbpnI/AAAAAAAAAw4/-CCuJO61cyM/S220/righteousninja.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5958718683792590789.post-5934279446913456116</id><published>2009-11-05T18:13:00.000-08:00</published><updated>2009-11-05T20:02:28.329-08:00</updated><title type='text'>Lesson 2 - Weather and News Widget Using RSS Reader</title><content type='html'>&lt;strong&gt;Summary&lt;/strong&gt;&lt;br /&gt;This is lesson&amp;nbsp;2 of 4. For this example we will use Google's RSS feed API to decode rss feeds and display them on a site. This widget will display weather taken from Yahoo's weather RSS feed and local news taken from two selected newspaper RSS feeds. &lt;a href="http://scriptdiaries.blogspot.com/2009/11/news-and-weather-widget-sri-lanka.html"&gt;&lt;strong&gt;&lt;span style="color: red;"&gt;View this Widget !!!&lt;/span&gt;&lt;/strong&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Explanation&lt;/strong&gt;&lt;br /&gt;First let us have a quick look at the code. First let's have a look at the weather.js file.&lt;br /&gt;&lt;table class="CD_Code_Table" border="1"&gt;&lt;tr&gt;&lt;td&gt;&lt;pre id="xxpre" class="CD_Code_Words"&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 1. &lt;/span&gt;/*      scriptdiaries.blogspot.com &lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 2. &lt;/span&gt;        Righteous Ninja aka Ping Ching.&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 3. &lt;/span&gt;        Free to use and modify.*/&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 4. &lt;/span&gt;        &lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 5. &lt;/span&gt;google.load("feeds", "1");&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 6. &lt;/span&gt;var YW_ContainerOk=false;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 7. &lt;/span&gt;function YW_GetWeatherResults(result){&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 8. &lt;/span&gt;    if (!result.error){&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 9. &lt;/span&gt;        s="&amp;lt;table  style=\"border-width:1px;border-collapse:collapse;border-style:solid; "+&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;10. &lt;/span&gt;            "border-color:#6D7B8D;width:1px;height:1px\" bgcolor=\"#ffffff\"&amp;gt;&amp;lt;tbody&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;"+&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;11. &lt;/span&gt;            result.feed.entries[0].content.match(/&amp;lt;img .*?&amp;gt;/)+"&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/tbody&amp;gt;&amp;lt;/table&amp;gt;";&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;12. &lt;/span&gt;        document.getElementById("YW_weather_container").innerHTML="&amp;lt;b&amp;gt;"+result.feed.entries[0].title+&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;13. &lt;/span&gt;            "&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;"+result.feed.entries[0].content.replace(/&amp;lt;img .*?&amp;gt;/,s);&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;14. &lt;/span&gt;    }&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;15. &lt;/span&gt;}&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;16. &lt;/span&gt;function YW_CallWeather(hrf){&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;17. &lt;/span&gt;    if(!YW_ContainerOk){&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;18. &lt;/span&gt;        document.write("&amp;lt;div id=\"YW_weather_container\"&amp;gt;There is no weather information available "+&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;19. &lt;/span&gt;        " for this location at this time&amp;lt;/div&amp;gt;");&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;20. &lt;/span&gt;        YW_ContainerOk=true;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;21. &lt;/span&gt;    }&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;22. &lt;/span&gt;    (new google.feeds.Feed(hrf)).load(YW_GetWeatherResults);&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;23. &lt;/span&gt;}&lt;/pre&gt;&lt;span class="CD_Code_Table_Footer"&gt;Hide line numbers &lt;/span&gt;&lt;input type="checkbox" onclick="ToggleLineNumbers(this.checked, this.parentNode)" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;Now let's have a look at the newsreader.js file&lt;br /&gt;&lt;table class="CD_Code_Table" border="1"&gt;&lt;tr&gt;&lt;td&gt;&lt;pre id="xxpre" class="CD_Code_Words"&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 1. &lt;/span&gt;/*      scriptdiaries.blogspot.com &lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 2. &lt;/span&gt;        Righteous Ninja aka Ping Ching.&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 3. &lt;/span&gt;        Free to use and modify.*/&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 4. &lt;/span&gt;        &lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 5. &lt;/span&gt;google.load("feeds", "1");&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 6. &lt;/span&gt;var NWS_ContainerOk = false;  &lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 7. &lt;/span&gt;function NWS_GetNewsResults(result){&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 8. &lt;/span&gt;    if (!result.error){&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 9. &lt;/span&gt;        for(i=0;i&amp;lt;result.feed.entries.length;i++){&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;10. &lt;/span&gt;            tmprs = result.feed.entries[i];&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;11. &lt;/span&gt;            document.getElementById("gansyman").innerHTML+="&amp;lt;a href=\""+tmprs.link+"\"&amp;gt;"+&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;12. &lt;/span&gt;                tmprs.title+"&amp;lt;/a&amp;gt;&amp;lt;br/&amp;gt;"+tmprs.content.substring(0,100)+"&amp;lt;br/&amp;gt;";&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;13. &lt;/span&gt;        }&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;14. &lt;/span&gt;    }&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;15. &lt;/span&gt;    else&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;16. &lt;/span&gt;        alert(result.error.message);&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;17. &lt;/span&gt;}&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;18. &lt;/span&gt;function NWS_CallNews(hrf, num){&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;19. &lt;/span&gt;    if(!NWS_ContainerOk){&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;20. &lt;/span&gt;        document.write("&amp;lt;div id=\"gansyman\"&amp;gt;&amp;lt;/div&amp;gt;");&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;21. &lt;/span&gt;        NWS_ContainerOk= true;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;22. &lt;/span&gt;    }&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;23. &lt;/span&gt;    var feed = new google.feeds.Feed(hrf)&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;24. &lt;/span&gt;    feed.setNumEntries(num);&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;25. &lt;/span&gt;    feed.load(NWS_GetNewsResults);&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;26. &lt;/span&gt;}&lt;/pre&gt;&lt;span class="CD_Code_Table_Footer"&gt;Hide line numbers &lt;/span&gt;&lt;input type="checkbox" onclick="ToggleLineNumbers(this.checked, this.parentNode)" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;Finally let us have a look at how you can embed this in an html page.&lt;br /&gt;&lt;table class="CD_Code_Table" border="1"&gt;&lt;tr&gt;&lt;td&gt;&lt;pre id="xxpre" class="CD_Code_Words"&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 1. &lt;/span&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 2. &lt;/span&gt;        &amp;lt;!--    &lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 3. &lt;/span&gt;        scriptdiaries.blogspot.com &lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 4. &lt;/span&gt;        Righteous Ninja aka Ping Ching.&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 5. &lt;/span&gt;        Free to use and modify.--&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 6. &lt;/span&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 7. &lt;/span&gt;&amp;lt;script type="text/javascript" src="http://www.google.com/jsapi?key=ABQIAAAA40MrnqI6U_ttOMK0wTpPSRQD6263AO_J-cN-o5MVlTXsf8kbcBRDZ3IoIMGa4lhUHoT28Z8OHamBhA"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 8. &lt;/span&gt;&amp;lt;script type="text/javascript" src="weather.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 9. &lt;/span&gt;&amp;lt;script type="text/javascript" src="newsreader.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;10. &lt;/span&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;11. &lt;/span&gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;12. &lt;/span&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;13. &lt;/span&gt;&amp;lt;h2&amp;gt;Weather&amp;lt;/h2&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;14. &lt;/span&gt;&amp;lt;table width="100%"&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;15. &lt;/span&gt;    &amp;lt;tbody&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;16. &lt;/span&gt;    &amp;lt;tr&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;17. &lt;/span&gt;        &amp;lt;td&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;18. &lt;/span&gt;        &amp;lt;select onChange="YW_CallWeather(this.options[this.selectedIndex].value)"&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;19. &lt;/span&gt;            &amp;lt;option value="http://weather.yahooapis.com/forecastrss?p=CEXX0001&amp;u=c"&amp;gt;Colombo&amp;lt;/option&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;20. &lt;/span&gt;            &amp;lt;option value="http://weather.yahooapis.com/forecastrss?p=CEXX0002&amp;u=c"&amp;gt;Moratuwa&amp;lt;/option&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;21. &lt;/span&gt;            &amp;lt;option value="http://weather.yahooapis.com/forecastrss?p=CEXX0003&amp;u=c"&amp;gt;Negombo&amp;lt;/option&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;22. &lt;/span&gt;            &amp;lt;option value="http://weather.yahooapis.com/forecastrss?p=CEXX0004&amp;u=c"&amp;gt;Sri Jayawardenepura&amp;lt;/option&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;23. &lt;/span&gt;            &amp;lt;option value="http://weather.yahooapis.com/forecastrss?p=CEXX0005&amp;u=c"&amp;gt;Katunayake&amp;lt;/option&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;24. &lt;/span&gt;        &amp;lt;/select&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;25. &lt;/span&gt;        &amp;lt;/td&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;26. &lt;/span&gt;    &amp;lt;/tr&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;27. &lt;/span&gt;    &amp;lt;tr&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;28. &lt;/span&gt;        &amp;lt;td&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;29. &lt;/span&gt;            &amp;lt;script&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;30. &lt;/span&gt;            YW_CallWeather("http://weather.yahooapis.com/forecastrss?p=CEXX0001&amp;u=c");&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;31. &lt;/span&gt;            &amp;lt;/script&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;32. &lt;/span&gt;        &amp;lt;/td&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;33. &lt;/span&gt;    &amp;lt;/tr&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;34. &lt;/span&gt;    &amp;lt;/tbody&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;35. &lt;/span&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;36. &lt;/span&gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;37. &lt;/span&gt;&amp;lt;h2&amp;gt;News&amp;lt;/h2&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;38. &lt;/span&gt;&amp;lt;script&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;39. &lt;/span&gt;NWS_CallNews("http://www.dailymirror.lk/DM_BLOG/RSS/FrontPageRSS.xml",3);&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;40. &lt;/span&gt;NWS_CallNews("http://www.lankanewspapers.com/news/rss.xml",3);&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;41. &lt;/span&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;42. &lt;/span&gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;43. &lt;/span&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;44. &lt;/span&gt;&amp;lt;/html&amp;gt;&lt;/pre&gt;&lt;span class="CD_Code_Table_Footer"&gt;Hide line numbers &lt;/span&gt;&lt;input type="checkbox" onclick="ToggleLineNumbers(this.checked, this.parentNode)" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://codediaries.com/script/examples/widget_lessons.zip"&gt;&lt;img src="http://codediaries.com/code/ico_download.gif" style="height: 40px; vertical-align: middle;" /&gt;You can download a zipped version of all the lessons here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://scriptdiaries.blogspot.com/2009/10/welcome-to-do-it-yourself-widgets.html"&gt;Back to the Lesson Index&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5958718683792590789-5934279446913456116?l=scriptdiaries.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scriptdiaries.blogspot.com/feeds/5934279446913456116/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5958718683792590789&amp;postID=5934279446913456116&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/5934279446913456116'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/5934279446913456116'/><link rel='alternate' type='text/html' href='http://scriptdiaries.blogspot.com/2009/11/lesson-2-weather-and-news-widget-using.html' title='Lesson 2 - Weather and News Widget Using RSS Reader'/><author><name>righteous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_tqP4IzwKwvc/SlFHxeKbpnI/AAAAAAAAAw4/-CCuJO61cyM/S220/righteousninja.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5958718683792590789.post-8488174627563430755</id><published>2009-11-05T18:10:00.000-08:00</published><updated>2009-11-05T20:02:36.428-08:00</updated><title type='text'>Lesson 1 - Sexy Widget That Displays a Sexy Quote and a Sexy Picture</title><content type='html'>&lt;strong&gt;Summary&lt;/strong&gt;&lt;br /&gt;This is lesson 1 of 4. It is the simplest form of widget possible. For this widget we will create some simple javascript that will randomly display an image and a quote. The images and quotes will be held in two arrays. The javascript Math.random function will be used to select an image. &lt;strong&gt;&lt;a href="http://diywidgets.blogspot.com/2009/11/sexy-image-and-quote-widget.html"&gt;&lt;span style="color: red;"&gt;View this Widget !!!&lt;/span&gt;&lt;/a&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Explanation&lt;/strong&gt;&lt;br /&gt;First let us have a quick look at the code. This is the simplest example so the code is very straigntforward.&lt;br /&gt;&lt;table class="CD_Code_Table" border="1"&gt;&lt;tr&gt;&lt;td&gt;&lt;pre id="xxpre" class="CD_Code_Words"&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 1. &lt;/span&gt;/*      scriptdiaries.blogspot.com &lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 2. &lt;/span&gt;        Righteous Ninja aka Ping Ching.&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 3. &lt;/span&gt;        Free to use and modify.*/&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 4. &lt;/span&gt;        &lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 5. &lt;/span&gt;var SXY_cutegirls = new Array("http://codediaries.com/widgets/cutelnka/wid_cutelnka_anarkalli.jpg",&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 6. &lt;/span&gt;                        "http://codediaries.com/widgets/cutelnka/wid_cutelnka_nadeeka.jpg",&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 7. &lt;/span&gt;                        "http://codediaries.com/widgets/cutelnka/wid_cutelnka_derana.jpg");&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 8. &lt;/span&gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 9. &lt;/span&gt;var SXY_cutequotes = new Array(&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;10. &lt;/span&gt;    "Sex without love is an empty experience, but as empty experiences go, it's one of the best.",&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;11. &lt;/span&gt;    "Sex is not the answer. Sex is the question. Yes is the answer.",&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;12. &lt;/span&gt;    "Sex without love is an empty experience, but as empty experiences go, it's one of the best.",&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;13. &lt;/span&gt;    "The sex was so good that even the neighbors had a cigarette.",&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;14. &lt;/span&gt;    "The difference between pornography and erotica is lighting.",&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;15. &lt;/span&gt;    "Sex is like a bridge game; if you don't have a good partner, you better have a good hand."&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;16. &lt;/span&gt;);&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;17. &lt;/span&gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;18. &lt;/span&gt;function SXY_DoSexyWidget(){&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;19. &lt;/span&gt;    document.getElementById('cutelankapanel').innerHTML=&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;20. &lt;/span&gt;        "&amp;lt;center&amp;gt;"+&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;21. &lt;/span&gt;        "&amp;lt;img src=\""+SXY_cutegirls[Math.round((SXY_cutegirls.length-1)*Math.random())]+"\"/&amp;gt;"+&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;22. &lt;/span&gt;        "&amp;lt;br/&amp;gt;"+&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;23. &lt;/span&gt;        SXY_cutequotes[Math.round((SXY_cutequotes.length-1)*Math.random())]+&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;24. &lt;/span&gt;        "&amp;lt;/center&amp;gt;";&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;25. &lt;/span&gt;}&lt;/pre&gt;&lt;span class="CD_Code_Table_Footer"&gt;Hide line numbers &lt;/span&gt;&lt;input type="checkbox" onclick="ToggleLineNumbers(this.checked, this.parentNode)" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;Now let us look at how you would embed this in a web page&lt;br /&gt;&lt;table class="CD_Code_Table" border="1"&gt;&lt;tr&gt;&lt;td&gt;&lt;pre id="xxpre" class="CD_Code_Words"&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 1. &lt;/span&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 2. &lt;/span&gt;        &amp;lt;!--    &lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 3. &lt;/span&gt;        scriptdiaries.blogspot.com &lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 4. &lt;/span&gt;        Righteous Ninja aka Ping Ching.&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 5. &lt;/span&gt;        Free to use and modify.--&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 6. &lt;/span&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 7. &lt;/span&gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 8. &lt;/span&gt;&amp;lt;style  TYPE="text/css"&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 9. &lt;/span&gt;.cutelanka_quotes{font-family:arial;font-size:11px;color:#ffffff;}&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;10. &lt;/span&gt;&amp;lt;/style&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;11. &lt;/span&gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;12. &lt;/span&gt;&amp;lt;script type="text/javascript" src="sexywidget.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;13. &lt;/span&gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;14. &lt;/span&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;15. &lt;/span&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;16. &lt;/span&gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;17. &lt;/span&gt;    &amp;lt;table border="0" cellpadding="0" cellspacing="0" width="190px"&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;18. &lt;/span&gt;        &amp;lt;tbody&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;19. &lt;/span&gt;            &amp;lt;tr&amp;gt;&amp;lt;td background="frame_top.gif" height="10px"&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;20. &lt;/span&gt;            &amp;lt;tr&amp;gt;&amp;lt;td bgcolor="#000000" class="cutelanka_quotes"&amp;gt;&amp;lt;div id="cutelankapanel" width="100%"&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;21. &lt;/span&gt;            &amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td background="frame_bottom.gif" height="10px"&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;22. &lt;/span&gt;        &amp;lt;/tbody&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;23. &lt;/span&gt;    &amp;lt;/table&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;24. &lt;/span&gt;&amp;lt;script&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;25. &lt;/span&gt;SXY_DoSexyWidget();&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;26. &lt;/span&gt;&amp;lt;/script&amp;gt;     &lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;27. &lt;/span&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;28. &lt;/span&gt;&amp;lt;/html&amp;gt;&lt;/pre&gt;&lt;span class="CD_Code_Table_Footer"&gt;Hide line numbers &lt;/span&gt;&lt;input type="checkbox" onclick="ToggleLineNumbers(this.checked, this.parentNode)" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://codediaries.com/script/examples/widget_lessons.zip"&gt;&lt;img src="http://codediaries.com/code/ico_download.gif" style="height: 40px; vertical-align: middle;" /&gt;You can download a zipped version of all the lessons here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://scriptdiaries.blogspot.com/2009/10/welcome-to-do-it-yourself-widgets.html"&gt;Back to the Lesson Index&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://codediaries.com/script/examples/widget_lessons.zip"&gt;&lt;img src="http://codediaries.com/code/ico_download.gif" style="height: 40px; vertical-align: middle;" /&gt;You can download a zipped version of all the lessons here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://scriptdiaries.blogspot.com/2009/10/welcome-to-do-it-yourself-widgets.html"&gt;Back to the Lesson Index&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5958718683792590789-8488174627563430755?l=scriptdiaries.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scriptdiaries.blogspot.com/feeds/8488174627563430755/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5958718683792590789&amp;postID=8488174627563430755&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/8488174627563430755'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/8488174627563430755'/><link rel='alternate' type='text/html' href='http://scriptdiaries.blogspot.com/2009/11/lesson-1-sexy-widget-that-displays-sexy.html' title='Lesson 1 - Sexy Widget That Displays a Sexy Quote and a Sexy Picture'/><author><name>righteous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_tqP4IzwKwvc/SlFHxeKbpnI/AAAAAAAAAw4/-CCuJO61cyM/S220/righteousninja.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5958718683792590789.post-455623874037358725</id><published>2009-11-05T00:35:00.001-08:00</published><updated>2009-11-05T16:43:50.934-08:00</updated><title type='text'>Sexy Random Image and Quote Widget</title><content type='html'>&lt;center&gt;&lt;style  TYPE="text/css"&gt;.cutelanka_quotes{font-family:arial;font-size:11px;color:#ffffff;}&lt;/style&gt;&lt;script type="text/javascript" src="http://codediaries.com/widgets/sexywidget/sexywidget.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;table border="0" cellpadding="0" cellspacing="0" width="190px"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td background="http://codediaries.com/widgets/common/wid_frame_top.gif" height="10px"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td bgcolor="#000000" class="cutelanka_quotes"&gt;&lt;div id="cutelankapanel" width="100%"&gt;&lt;/div&gt;&lt;/td&gt;         &lt;/tr&gt;&lt;tr&gt;&lt;td background="http://codediaries.com/widgets/common/wid_frame_bottom.gif" height="10px"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt; &lt;/table&gt;&lt;script&gt;SXY_DoSexyWidget(   new Array("http://codediaries.com/widgets/sexywidget/wid_cutelnka_anarkalli.jpg",                    "http://codediaries.com/widgets/sexywidget/wid_cutelnka_nadeeka.jpg",                    "http://codediaries.com/widgets/sexywidget/wid_cutelnka_derana.jpg"),                new Array("Sex without love is an empty experience, but as empty experiences go, it's one of the best.",                    "Sex is not the answer. Sex is the question. Yes is the answer.",                    "Sex without love is an empty experience, but as empty experiences go, it's one of the best.",                    "The sex was so good that even the neighbors had a cigarette.",                    "The difference between pornography and erotica is lighting.",                    "Sex is like a bridge game; if you don't have a good partner, you better have a good hand.")                );&lt;/script&gt;&lt;/center&gt;&lt;br /&gt;&lt;table class="SD_Widget_Desc"&gt;&lt;tr&gt; &lt;td&gt;&lt;a href="http://scriptdiaries.blogspot.com/2009/11/lesson-1-sexy-widget-that-displays-sexy.html"&gt;Learn more about this Widget&lt;/a&gt;&lt;br /&gt;Super sexy widget that displays a random hot girl with a sexy and funny quote. Refresh page for a different quote and image. This can be easily changed to include any images and any number of quotes. Pure javascript only.&lt;/td&gt; &lt;/tr&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5958718683792590789-455623874037358725?l=scriptdiaries.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scriptdiaries.blogspot.com/feeds/455623874037358725/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5958718683792590789&amp;postID=455623874037358725&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/455623874037358725'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/455623874037358725'/><link rel='alternate' type='text/html' href='http://scriptdiaries.blogspot.com/2009/11/sexy-random-image-and-quote-widget.html' title='Sexy Random Image and Quote Widget'/><author><name>righteous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_tqP4IzwKwvc/SlFHxeKbpnI/AAAAAAAAAw4/-CCuJO61cyM/S220/righteousninja.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5958718683792590789.post-896781013078742492</id><published>2009-11-04T17:54:00.000-08:00</published><updated>2009-11-04T17:55:39.774-08:00</updated><title type='text'>News and Weather Widget - Sri Lanka</title><content type='html'>&lt;script type="text/javascript" src="http://www.google.com/jsapi?key=ABQIAAAA40MrnqI6U_ttOMK0wTpPSRRRMxoOMOtxx4cZURXZ8p-ktCKCkRRp278BfhgFUgeZXRbTxXfmTVxWxg"&gt;&lt;/script&gt;&lt;script type="text/javascript" src="http://codediaries.com/widgets/rss/wid_yweather.js"&gt;&lt;/script&gt;&lt;script type="text/javascript" src="http://codediaries.com/widgets/rss/wid_newsreader.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;h2&gt;Sri Lanka Weather&lt;/h2&gt;&lt;table width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;select onChange="YW_CallWeather(this.options[this.selectedIndex].value)"&gt;&lt;br /&gt;&lt;option value="http://weather.yahooapis.com/forecastrss?p=CEXX0001&amp;u=c"&gt;Colombo&lt;/option&gt;&lt;br /&gt;&lt;option value="http://weather.yahooapis.com/forecastrss?p=CEXX0002&amp;u=c"&gt;Moratuwa&lt;/option&gt;&lt;br /&gt;&lt;option value="http://weather.yahooapis.com/forecastrss?p=CEXX0003&amp;u=c"&gt;Negombo&lt;/option&gt;&lt;br /&gt;&lt;option value="http://weather.yahooapis.com/forecastrss?p=CEXX0004&amp;u=c"&gt;Sri Jayawardenepura&lt;/option&gt;&lt;br /&gt;&lt;option value="http://weather.yahooapis.com/forecastrss?p=CEXX0005&amp;u=c"&gt;Katunayake&lt;/option&gt;&lt;br /&gt;&lt;/select&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;script&gt;YW_CallWeather("http://weather.yahooapis.com/forecastrss?p=CEXX0001&amp;u=c");&lt;/script&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;h2&gt;Sri Lanka News&lt;/h2&gt;&lt;script&gt;NWS_CallNews("http://www.dailymirror.lk/DM_BLOG/RSS/FrontPageRSS.xml",3);NWS_CallNews("http://www.lankanewspapers.com/news/rss.xml",3);&lt;/script&gt;&lt;br /&gt;&lt;table class="SD_Widget_Desc"&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://scriptdiaries.blogspot.com/2009/11/lesson-2-weather-and-news-widget-using.html"&gt;Learn more about this widget&lt;/a&gt;&lt;br /&gt;A RSS feed widget that displays the news and weather in Sri Lanka. This uses Google's feed API, Yahoo's weather RSS feed and the feeds from two Sri Lankan Newspapers. This widget can be easily adapted to display news and weather from any country or a combination of countries.&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5958718683792590789-896781013078742492?l=scriptdiaries.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scriptdiaries.blogspot.com/feeds/896781013078742492/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5958718683792590789&amp;postID=896781013078742492&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/896781013078742492'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/896781013078742492'/><link rel='alternate' type='text/html' href='http://scriptdiaries.blogspot.com/2009/11/news-and-weather-widget-sri-lanka.html' title='News and Weather Widget - Sri Lanka'/><author><name>righteous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_tqP4IzwKwvc/SlFHxeKbpnI/AAAAAAAAAw4/-CCuJO61cyM/S220/righteousninja.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5958718683792590789.post-6435622145006919608</id><published>2009-11-04T03:47:00.001-08:00</published><updated>2009-11-04T16:16:31.713-08:00</updated><title type='text'>What is on Kim Kardashians Mind? Twitter Thoughts Widget</title><content type='html'>&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;img src="http://images.paraorkut.com/img/pics/images/k/kim_kardashian-12232.jpg"/&gt;&lt;/td&gt;&lt;td width="100%"&gt;&lt;iframe iframe scrolling="no" frameborder="0" height="500px" width="100%" src="http://codediaries.com/widgets/twitterthoughts/twitterthoughts_embed.html?user=25365536"&gt;&lt;/iframe&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;table class="SD_Widget_Desc"&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://scriptdiaries.blogspot.com/2009/11/lesson-4-advanced-twitter-widget-using.html"&gt;Learn more about this widget&lt;/a&gt;&lt;br /&gt;A twiter widget that displays what has been on Kim Kardashian's mind for the past week. This widget can be easily adapted to display any celebrity or entity on twittter.&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5958718683792590789-6435622145006919608?l=scriptdiaries.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scriptdiaries.blogspot.com/feeds/6435622145006919608/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5958718683792590789&amp;postID=6435622145006919608&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/6435622145006919608'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/6435622145006919608'/><link rel='alternate' type='text/html' href='http://scriptdiaries.blogspot.com/2009/11/what-is-on-kim-kardashians-mind-twitter.html' title='What is on Kim Kardashians Mind? Twitter Thoughts Widget'/><author><name>righteous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_tqP4IzwKwvc/SlFHxeKbpnI/AAAAAAAAAw4/-CCuJO61cyM/S220/righteousninja.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5958718683792590789.post-3916630851589095541</id><published>2009-11-01T17:47:00.000-08:00</published><updated>2009-11-05T00:27:44.995-08:00</updated><title type='text'>What is on Paris Hilton's Mind? Twitter Thoughts Widget</title><content type='html'>&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;img src="http://www.theregister.co.uk/2005/05/24/paris_hilton.jpg" /&gt;&lt;br /&gt;&lt;/td&gt;&lt;td width="100%"&gt;&lt;iframe frameborder="0" height="450" iframe="" scrolling="no" src="http://codediaries.com/widgets/twitterthoughts/twitterthoughts_embed.html?user=24929621" width="100%"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table class="SD_Widget_Desc"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://scriptdiaries.blogspot.com/2009/11/lesson-4-advanced-twitter-widget-using.html"&gt;Learn more about this widget&lt;/a&gt;&lt;br /&gt;A twiter widget that displays what has been on Paris Hilton's mind for the past week. This widget can be easily adapted to display any celebrity or entity on Twittter. Pure Javascript only. Using Twitter and Yahoo APIs.&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5958718683792590789-3916630851589095541?l=scriptdiaries.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scriptdiaries.blogspot.com/feeds/3916630851589095541/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5958718683792590789&amp;postID=3916630851589095541&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/3916630851589095541'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/3916630851589095541'/><link rel='alternate' type='text/html' href='http://scriptdiaries.blogspot.com/2009/11/what-is-on-paris-hiltons-mind-twitter.html' title='What is on Paris Hilton&apos;s Mind? Twitter Thoughts Widget'/><author><name>righteous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_tqP4IzwKwvc/SlFHxeKbpnI/AAAAAAAAAw4/-CCuJO61cyM/S220/righteousninja.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5958718683792590789.post-5897652497531394763</id><published>2009-10-21T00:35:00.001-07:00</published><updated>2009-10-21T00:35:11.165-07:00</updated><title type='text'>Free APIs That You Can use To Create Your Widget</title><content type='html'>There are heaps and heaps of free APIs on the web that you can use to mash up and create a widget. Most of the giants such as yahoo, google, twitter, digg etc have APIs that allow you to leverage off their search and social networking engines. Here we will list only the big names, but there are thousands of equally if not better services offered by smaller players for free.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5958718683792590789-5897652497531394763?l=scriptdiaries.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scriptdiaries.blogspot.com/feeds/5897652497531394763/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5958718683792590789&amp;postID=5897652497531394763&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/5897652497531394763'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/5897652497531394763'/><link rel='alternate' type='text/html' href='http://scriptdiaries.blogspot.com/2009/10/free-apis-that-you-can-use-to-create.html' title='Free APIs That You Can use To Create Your Widget'/><author><name>righteous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_tqP4IzwKwvc/SlFHxeKbpnI/AAAAAAAAAw4/-CCuJO61cyM/S220/righteousninja.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5958718683792590789.post-2956685060877458943</id><published>2009-10-21T00:29:00.001-07:00</published><updated>2009-12-20T15:08:42.570-08:00</updated><title type='text'>Welcome to Do It Yourself Widgets</title><content type='html'>This article has moved back to Code Diaries,&lt;br /&gt;&lt;br /&gt;You can find it at &lt;a href="http://codediaries.blogspot.com/2009/12/create-your-own-widgets.html"&gt;Learn How to Crete Pure Javascript Widgets&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5958718683792590789-2956685060877458943?l=scriptdiaries.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scriptdiaries.blogspot.com/feeds/2956685060877458943/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5958718683792590789&amp;postID=2956685060877458943&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/2956685060877458943'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/2956685060877458943'/><link rel='alternate' type='text/html' href='http://scriptdiaries.blogspot.com/2009/10/welcome-to-do-it-yourself-widgets.html' title='Welcome to Do It Yourself Widgets'/><author><name>righteous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_tqP4IzwKwvc/SlFHxeKbpnI/AAAAAAAAAw4/-CCuJO61cyM/S220/righteousninja.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5958718683792590789.post-4710982430346462005</id><published>2009-10-20T20:10:00.000-07:00</published><updated>2009-12-20T15:08:16.958-08:00</updated><title type='text'>Moving, Hiding and Writing to a Layer in Javascript</title><content type='html'>This article has moved back to Code Diaries.&lt;br /&gt;&lt;br /&gt;You can find it at &lt;a href="http://codediaries.blogspot.com/2009/11/moving-hiding-and-changing-contents-of.html"&gt;Moving, Hiding and Writing to a Layer in Javascript&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5958718683792590789-4710982430346462005?l=scriptdiaries.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scriptdiaries.blogspot.com/feeds/4710982430346462005/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5958718683792590789&amp;postID=4710982430346462005&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/4710982430346462005'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/4710982430346462005'/><link rel='alternate' type='text/html' href='http://scriptdiaries.blogspot.com/2009/10/moving-hiding-and-writing-to-layer-in.html' title='Moving, Hiding and Writing to a Layer in Javascript'/><author><name>righteous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_tqP4IzwKwvc/SlFHxeKbpnI/AAAAAAAAAw4/-CCuJO61cyM/S220/righteousninja.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5958718683792590789.post-6252915893957159115</id><published>2009-10-14T16:21:00.000-07:00</published><updated>2009-10-14T16:21:08.687-07:00</updated><title type='text'>Increase Widget Font Size in Blogger(Blogspot)</title><content type='html'>If you would like to simply icrease the font size in the widget content without installing other widgets or embedding fancy javascript, you can edit the size in the template. Go to the Dashboard, click on Layout and select Edit HTML. Now look for the text below.&lt;br /&gt;&lt;br /&gt;&lt;table class="CD_Code_Table" border="1"&gt;&lt;tr&gt;&lt;td&gt;&lt;pre id="xxpre" class="CD_Code_Words"&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 1. &lt;/span&gt;.widget-content { &lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 2. &lt;/span&gt;  margin-top: 0.5em;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 3. &lt;/span&gt;}&lt;/pre&gt;&lt;span class="CD_Code_Table_Footer"&gt;Hide line numbers &lt;/span&gt;&lt;input type="checkbox" onclick="ToggleLineNumbers(this.checked, this.parentNode)" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;You can modify this to increase the size, font, color etc of the widget content like so.&lt;br /&gt;&lt;table class="CD_Code_Table" border="1"&gt;&lt;tr&gt;&lt;td&gt;&lt;pre id="xxpre" class="CD_Code_Words"&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 1. &lt;/span&gt;.widget-content { &lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 2. &lt;/span&gt;  margin-top: 0.5em;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 3. &lt;/span&gt;  font-size:110%; &lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 4. &lt;/span&gt;  color:#FF6600;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 5. &lt;/span&gt;}&lt;/pre&gt;&lt;span class="CD_Code_Table_Footer"&gt;Hide line numbers &lt;/span&gt;&lt;input type="checkbox" onclick="ToggleLineNumbers(this.checked, this.parentNode)" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5958718683792590789-6252915893957159115?l=scriptdiaries.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scriptdiaries.blogspot.com/feeds/6252915893957159115/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5958718683792590789&amp;postID=6252915893957159115&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/6252915893957159115'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/6252915893957159115'/><link rel='alternate' type='text/html' href='http://scriptdiaries.blogspot.com/2009/10/increase-widget-font-size-in.html' title='Increase Widget Font Size in Blogger(Blogspot)'/><author><name>righteous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_tqP4IzwKwvc/SlFHxeKbpnI/AAAAAAAAAw4/-CCuJO61cyM/S220/righteousninja.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5958718683792590789.post-1587082141855385078</id><published>2009-10-13T20:21:00.000-07:00</published><updated>2009-10-13T20:22:47.777-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gemette'/><title type='text'>Remove the Blogger(Blogspot) Navi Bar/Banner at the Top</title><content type='html'>If you want to remove the Blogger bar at the top because it's clashing with your site. Many people seem to think this is illegal, that is up to you to decide. Go to the Dashboard. Click on Layout and then click "Edit HTML". Now stick this bit of code somewhere. &lt;br /&gt;&lt;br /&gt;#navbar-iframe {&lt;br /&gt;display: none;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Easiest is just before the "body {" and after the variable definitions. So your template should have this bit of code in it like below.&lt;br /&gt;&lt;table class="CD_Code_Table" border="1"&gt;&lt;tr&gt;&lt;td&gt;&lt;pre id="xxpre" class="CD_Code_Words"&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 1. &lt;/span&gt;   &amp;lt;Variable name="endSide" description="End side in blog language"&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 2. &lt;/span&gt;             type="automatic" default="right" value="right"&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 3. &lt;/span&gt;*/&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 4. &lt;/span&gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 5. &lt;/span&gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 6. &lt;/span&gt;#navbar-iframe {&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 7. &lt;/span&gt;   display: none;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 8. &lt;/span&gt;}&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 9. &lt;/span&gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;10. &lt;/span&gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;11. &lt;/span&gt;body {&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;12. &lt;/span&gt;  margin:0px;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;13. &lt;/span&gt;  padding:0px;&lt;/pre&gt;&lt;span class="CD_Code_Table_Footer"&gt;Hide line numbers &lt;/span&gt;&lt;input type="checkbox" onclick="ToggleLineNumbers(this.checked, this.parentNode)" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5958718683792590789-1587082141855385078?l=scriptdiaries.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scriptdiaries.blogspot.com/feeds/1587082141855385078/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5958718683792590789&amp;postID=1587082141855385078&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/1587082141855385078'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/1587082141855385078'/><link rel='alternate' type='text/html' href='http://scriptdiaries.blogspot.com/2009/10/remove-bloggerblogspot-navi-barbanner.html' title='Remove the Blogger(Blogspot) Navi Bar/Banner at the Top'/><author><name>righteous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_tqP4IzwKwvc/SlFHxeKbpnI/AAAAAAAAAw4/-CCuJO61cyM/S220/righteousninja.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5958718683792590789.post-7054622158705387097</id><published>2009-10-13T15:40:00.001-07:00</published><updated>2009-12-15T20:22:35.627-08:00</updated><title type='text'>Web 2 Tips and Tricks</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_tqP4IzwKwvc/Syd3-PAA5BI/AAAAAAAABBI/CjPPIqdqizk/s1600-h/twitterwidget.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img style="border:2px solid blue" height="229" src="http://2.bp.blogspot.com/_tqP4IzwKwvc/Syd3-PAA5BI/AAAAAAAABBI/CjPPIqdqizk/s320/twitterwidget.JPG" width="320" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;Helpful hints when creating web 2 widgets, writing perl code or setting up a page to use php or ssi. Hint's and tips you would not find anywhere else.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5958718683792590789-7054622158705387097?l=scriptdiaries.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scriptdiaries.blogspot.com/feeds/7054622158705387097/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5958718683792590789&amp;postID=7054622158705387097&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/7054622158705387097'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/7054622158705387097'/><link rel='alternate' type='text/html' href='http://scriptdiaries.blogspot.com/2009/10/web-2-tips-and-tricks.html' title='Web 2 Tips and Tricks'/><author><name>righteous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_tqP4IzwKwvc/SlFHxeKbpnI/AAAAAAAAAw4/-CCuJO61cyM/S220/righteousninja.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_tqP4IzwKwvc/Syd3-PAA5BI/AAAAAAAABBI/CjPPIqdqizk/s72-c/twitterwidget.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5958718683792590789.post-365771122172668624</id><published>2009-10-13T15:38:00.001-07:00</published><updated>2009-10-15T02:54:03.231-07:00</updated><title type='text'>Javascript Need to Know</title><content type='html'>Everything you need to know about javascript. DOM, XML, AJAX. With the basics outlined in the following tutorials, you could make the richest and most inreactive site or widget.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://scriptdiaries.blogspot.com/2009/09/javascript-asynchronous-xml-example.html"&gt;Asynchronous Javascript&amp;nbsp;and XML (AJAX) Example&lt;/a&gt;&lt;br /&gt;&lt;a href="http://scriptdiaries.blogspot.com/2009/10/creating-class-in-javascript.html"&gt;Creating a Class in Javascript&lt;/a&gt;&lt;br /&gt;&lt;a href="http://scriptdiaries.blogspot.com/2009/09/javascript-get-url-parameters-from-form.html"&gt;Getting URL "GET" parameters&amp;nbsp;using Javascript&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5958718683792590789-365771122172668624?l=scriptdiaries.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scriptdiaries.blogspot.com/feeds/365771122172668624/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5958718683792590789&amp;postID=365771122172668624&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/365771122172668624'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/365771122172668624'/><link rel='alternate' type='text/html' href='http://scriptdiaries.blogspot.com/2009/10/javascript-need-to-know.html' title='Javascript Need to Know'/><author><name>righteous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_tqP4IzwKwvc/SlFHxeKbpnI/AAAAAAAAAw4/-CCuJO61cyM/S220/righteousninja.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5958718683792590789.post-7818241461028121529</id><published>2009-10-12T19:36:00.000-07:00</published><updated>2009-12-20T15:18:12.690-08:00</updated><title type='text'>Creating a Class in Perl</title><content type='html'>This article has moved back to Code Diaries.&lt;br /&gt;&lt;br /&gt;You can view it there at &lt;a href="http://codediaries.blogspot.com/2009/11/creating-class-in-perl-with-public.html"&gt;Creating a Class in Perl&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5958718683792590789-7818241461028121529?l=scriptdiaries.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scriptdiaries.blogspot.com/feeds/7818241461028121529/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5958718683792590789&amp;postID=7818241461028121529&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/7818241461028121529'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/7818241461028121529'/><link rel='alternate' type='text/html' href='http://scriptdiaries.blogspot.com/2009/10/creating-class-in-perl.html' title='Creating a Class in Perl'/><author><name>righteous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_tqP4IzwKwvc/SlFHxeKbpnI/AAAAAAAAAw4/-CCuJO61cyM/S220/righteousninja.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5958718683792590789.post-7847309396933386486</id><published>2009-10-09T03:42:00.000-07:00</published><updated>2009-12-20T15:16:57.506-08:00</updated><title type='text'>Creating a Class in Javascript</title><content type='html'>This article has moved back to Code Diaries.&lt;br /&gt;&lt;br /&gt;You can find it there at &lt;a href="http://codediaries.blogspot.com/2009/11/creating-classes-in-javascript.html"&gt;Creating a Class in Javascript&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5958718683792590789-7847309396933386486?l=scriptdiaries.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scriptdiaries.blogspot.com/feeds/7847309396933386486/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5958718683792590789&amp;postID=7847309396933386486&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/7847309396933386486'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/7847309396933386486'/><link rel='alternate' type='text/html' href='http://scriptdiaries.blogspot.com/2009/10/creating-class-in-javascript.html' title='Creating a Class in Javascript'/><author><name>righteous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_tqP4IzwKwvc/SlFHxeKbpnI/AAAAAAAAAw4/-CCuJO61cyM/S220/righteousninja.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5958718683792590789.post-1081388099548192639</id><published>2009-09-30T04:41:00.000-07:00</published><updated>2009-10-09T02:56:30.057-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>Javascript Asynchronous XML Example (AJAX)</title><content type='html'>This is a simple AJAX tutorial using php, javascript and XMLHttpRequest. AJAX is the fundamental lynchpin of web 2 services and underpins almost every widget today. This is the simplest example that demonstrates AJAX.&lt;br /&gt;&lt;br /&gt;This example consists of two files. &lt;em&gt;ajaxexample.html&lt;/em&gt; contains all the javascript and &lt;em&gt;getresult.php&lt;/em&gt; is the php backend that returns an xml result. Create or copy these two files into the same directory on a webserver (such as apache) that supports php.&lt;br /&gt;&lt;br /&gt;ajaxexample.html&lt;br /&gt;&lt;table class="CD_Code_Table" border="1"&gt;&lt;tr&gt;&lt;td&gt;&lt;pre id="xxpre" class="CD_Code_Words"&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 1. &lt;/span&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 2. &lt;/span&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 3. &lt;/span&gt;&amp;lt;script language="javascript"&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 4. &lt;/span&gt;function new_XHR() {&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 5. &lt;/span&gt;    var xhr;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 6. &lt;/span&gt;    try{&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 7. &lt;/span&gt;        xhr = new ActiveXObject("Msxml2.XMLHTTP");&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 8. &lt;/span&gt;    }catch(e){&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 9. &lt;/span&gt;    try{&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;10. &lt;/span&gt;        xhr = new ActiveXObject("Microsoft.XMLHTTP");&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;11. &lt;/span&gt;        }catch(E){&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;12. &lt;/span&gt;            xhr = false;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;13. &lt;/span&gt;        }&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;14. &lt;/span&gt;    }&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;15. &lt;/span&gt;    if(!xhr &amp;&amp; typeof XMLHttpRequest != 'undefined'){&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;16. &lt;/span&gt;        xhr = new XMLHttpRequest();&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;17. &lt;/span&gt;    }&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;18. &lt;/span&gt;    return xhr;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;19. &lt;/span&gt;}&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;20. &lt;/span&gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;21. &lt;/span&gt;var myxhr;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;22. &lt;/span&gt;function DoAjaxCall(){&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;23. &lt;/span&gt;      myxhr = new_XHR();&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;24. &lt;/span&gt;      myxhr.onreadystatechange=MyAjaxCallback;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;25. &lt;/span&gt;      myxhr.open('GET',"getresult.php?"&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;26. &lt;/span&gt;        +"name="+document.getElementById("NameBox").value);&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;27. &lt;/span&gt;      myxhr.send(null);&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;28. &lt;/span&gt;    }&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;29. &lt;/span&gt;       &lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;30. &lt;/span&gt;function MyAjaxCallback(){&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;31. &lt;/span&gt;    var name;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;32. &lt;/span&gt;    var message;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;33. &lt;/span&gt;    if(myxhr.readyState==4 &amp;&amp; myxhr.status==200){&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;34. &lt;/span&gt;        var subrootNode = myxhr.responseXML.getElementsByTagName('user-data');&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;35. &lt;/span&gt;        for(i = 0 ; i &amp;lt; subrootNode[0].childNodes.length ; i++){&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;36. &lt;/span&gt;            var node = subrootNode[0].childNodes[i];&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;37. &lt;/span&gt;            if(node.tagName=="name")&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;38. &lt;/span&gt;                name=node.firstChild.nodeValue;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;39. &lt;/span&gt;            else if(node.tagName=="message")&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;40. &lt;/span&gt;                message=node.firstChild.nodeValue;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;41. &lt;/span&gt;            else{}&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;42. &lt;/span&gt;        }&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;43. &lt;/span&gt;        document.getElementById("MessagePane").innerHTML = &lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;44. &lt;/span&gt;                                    "&amp;lt;b&amp;gt;"+name+" :&amp;lt;/b&amp;gt; \""+message+"\""; &lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;45. &lt;/span&gt;    }&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;46. &lt;/span&gt;}&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;47. &lt;/span&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;48. &lt;/span&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;49. &lt;/span&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;50. &lt;/span&gt;&amp;lt;form&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;51. &lt;/span&gt;Name &amp;lt;input id="NameBox" type="text"/&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;52. &lt;/span&gt;&amp;lt;a href="javascript:DoAjaxCall()"&amp;gt;Send the data without submitting the form&amp;lt;/a&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;53. &lt;/span&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;54. &lt;/span&gt;&amp;lt;div id="MessagePane"/&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;55. &lt;/span&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt;56. &lt;/span&gt;&amp;lt;/html&amp;gt;&lt;/pre&gt;&lt;span class="CD_Code_Table_Footer"&gt;Hide line numbers &lt;/span&gt;&lt;input type="checkbox" onclick="ToggleLineNumbers(this.checked, this.parentNode)" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;Now type http://127.0.0.1/WEB/AJAXExample/ajaxexample.html in a browser, type your name in the textbox and click on the link.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;lines 4-19&lt;/strong&gt; Creates an XMLHttpRequest object&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;lines 22-28&lt;/strong&gt; DoAjaxCall get's called when you click on the link. This creates an XMLHttpRequest object sets MyAjaxCallback as the callback function and adds the url to call.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;lines 30-46&lt;/strong&gt; Once getresult.php is called the MyAjaxCallback function is called with the reuslt. You can then 'decode' the XMLHttpRequest object by traversing the sctructure and extracting the information.&lt;br /&gt;&lt;br /&gt;getresutl.php&lt;br /&gt;&lt;table border="1" class="CD_Code_Table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;pre class="CD_Code_Words" id="xxpre"&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt; 1. &lt;/span&gt;&amp;lt;?php header('Content-type: text/xml');&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt; 2. &lt;/span&gt; &lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt; 3. &lt;/span&gt;$my_name = $_GET["name"];&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt; 4. &lt;/span&gt;&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt; 5. &lt;/span&gt;$dom = new DomDocument('1.0');&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt; 6. &lt;/span&gt;$dom-&amp;gt;formatOutput = true;&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt; 7. &lt;/span&gt;&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt; 8. &lt;/span&gt;$userdata = $dom-&amp;gt;createElement( "user-data" );&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt; 9. &lt;/span&gt;$dom-&amp;gt;appendChild( $userdata );&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;10. &lt;/span&gt;&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;11. &lt;/span&gt;$name = $dom-&amp;gt;createElement("name");&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;12. &lt;/span&gt;$name-&amp;gt;appendChild($dom-&amp;gt;createTextNode("Doctor Octopus"));&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;13. &lt;/span&gt;$userdata-&amp;gt;appendChild($name);&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;14. &lt;/span&gt;&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;15. &lt;/span&gt;$mesg = $dom-&amp;gt;createElement("message");&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;16. &lt;/span&gt;$mesg-&amp;gt;appendChild($dom-&amp;gt;createTextNode("Hello there $my_name, prepare to be mangled"));&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;17. &lt;/span&gt;$userdata-&amp;gt;appendChild($mesg);&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;18. &lt;/span&gt;&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;19. &lt;/span&gt;echo $dom-&amp;gt;saveXml();&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;20. &lt;/span&gt;&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;21. &lt;/span&gt;?&amp;gt;&lt;/pre&gt;&lt;span class="CD_Code_Table_Footer"&gt;Hide line numbers &lt;/span&gt;&lt;input onclick="ToggleLineNumbers(this.checked, this.parentNode)" type="checkbox" /&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;You can call this php script directly by typeing &lt;em&gt;http://127.0.0.1/WEB/AJAXExample/getresult.php?name=sheena&lt;/em&gt; in your browser&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5958718683792590789-1081388099548192639?l=scriptdiaries.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scriptdiaries.blogspot.com/feeds/1081388099548192639/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5958718683792590789&amp;postID=1081388099548192639&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/1081388099548192639'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/1081388099548192639'/><link rel='alternate' type='text/html' href='http://scriptdiaries.blogspot.com/2009/09/javascript-asynchronous-xml-example.html' title='Javascript Asynchronous XML Example (AJAX)'/><author><name>righteous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_tqP4IzwKwvc/SlFHxeKbpnI/AAAAAAAAAw4/-CCuJO61cyM/S220/righteousninja.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5958718683792590789.post-4807970748228411884</id><published>2009-09-22T03:59:00.001-07:00</published><updated>2009-10-09T03:08:44.177-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='php'/><category scheme='http://www.blogger.com/atom/ns#' term='database'/><title type='text'>PHP Database Example - MySQL</title><content type='html'>This is a simple php Database example illustrating the basics such as creating an SQL query, fetching and updating a database. For this example we will be using a MySQL Database. However, this will work with any database. This example will use commands such as mysql_connect, mysql_fetch_object, mysql_query etc.&lt;br /&gt;&lt;br /&gt;First lets have a look at the example. It's self explanatory.&lt;br /&gt;&lt;table border="1" class="CD_Code_Table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;pre class="CD_Code_Words" id="xxpre"&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt; 1. &lt;/span&gt;&amp;lt;?php&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt; 2. &lt;/span&gt;try{&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt; 3. &lt;/span&gt;    mysql_connect("localhost", "user1", "pwd");&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt; 4. &lt;/span&gt;    mysql_select_db("mydatabase");&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt; 5. &lt;/span&gt;}catch(Exception $e){&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt; 6. &lt;/span&gt;    echo mysql_error();&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt; 7. &lt;/span&gt;    exit;&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt; 8. &lt;/span&gt;}&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt; 9. &lt;/span&gt;/*Select*/&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;10. &lt;/span&gt;$result = mysql_query('select * from user_table');&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;11. &lt;/span&gt;&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;12. &lt;/span&gt;while($row = mysql_fetch_object($result)) {&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;13. &lt;/span&gt;  echo "$row-&amp;gt;id $row-&amp;gt;first_name $row-&amp;gt;address\n"; &lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;14. &lt;/span&gt;}&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;15. &lt;/span&gt;&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;16. &lt;/span&gt;/*Update*/&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;17. &lt;/span&gt;$result=mysql_query("update user_table set first_name='barbie' where id=100");&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;18. &lt;/span&gt;&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;19. &lt;/span&gt;mysql_close();&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;20. &lt;/span&gt;&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;21. &lt;/span&gt;?&amp;gt;&lt;/pre&gt;&lt;span class="CD_Code_Table_Footer"&gt;Hide line numbers &lt;/span&gt;&lt;input onclick="ToggleLineNumbers(this.checked, this.parentNode)" type="checkbox" /&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5958718683792590789-4807970748228411884?l=scriptdiaries.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scriptdiaries.blogspot.com/feeds/4807970748228411884/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5958718683792590789&amp;postID=4807970748228411884&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/4807970748228411884'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/4807970748228411884'/><link rel='alternate' type='text/html' href='http://scriptdiaries.blogspot.com/2009/09/php-database-example.html' title='PHP Database Example - MySQL'/><author><name>righteous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_tqP4IzwKwvc/SlFHxeKbpnI/AAAAAAAAAw4/-CCuJO61cyM/S220/righteousninja.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5958718683792590789.post-4924227538204068713</id><published>2009-09-22T03:31:00.001-07:00</published><updated>2009-10-09T02:59:36.223-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DOM'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>PHP DOM XML Example - Document Object Model</title><content type='html'>This is a simple php 5, DOM/XML example illustrating the basics such as creating tags, name/vaule pairs and text nodes using createElement, appendChild , setAttribute etc. The XML is displayed on the console, but could just as well be the response to an XMLHttpRequest.&lt;br /&gt;&lt;br /&gt;First lets have a look at the example. It's self explanatory.&lt;br /&gt;&lt;table border="1" class="CD_Code_Table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;pre class="CD_Code_Words" id="xxpre"&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt; 1. &lt;/span&gt;&amp;lt;?php &lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt; 2. &lt;/span&gt;&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt; 3. &lt;/span&gt;$dom = new DomDocument('1.0');&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt; 4. &lt;/span&gt;$dom-&amp;gt;formatOutput = true;&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt; 5. &lt;/span&gt;&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt; 6. &lt;/span&gt;$carroot = $dom-&amp;gt;createElement("car-root");&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt; 7. &lt;/span&gt;$dom-&amp;gt;appendChild($carroot);&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt; 8. &lt;/span&gt;&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt; 9. &lt;/span&gt;$car = $dom-&amp;gt;createElement("car");&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;10. &lt;/span&gt;$car-&amp;gt;setAttribute("model","Ferrari F60");&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;11. &lt;/span&gt;$carroot-&amp;gt;appendChild($car);&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;12. &lt;/span&gt;&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;13. &lt;/span&gt;$description = $dom-&amp;gt;createElement("description");&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;14. &lt;/span&gt;$description-&amp;gt;appendChild($dom-&amp;gt;createTextNode("Enzo Ferrari"));&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;15. &lt;/span&gt;$car-&amp;gt;appendChild($description);&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;16. &lt;/span&gt;&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;17. &lt;/span&gt;$engine = $dom-&amp;gt;createElement("engine");&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;18. &lt;/span&gt;$engine-&amp;gt;appendChild($dom-&amp;gt;createTextNode("V12"));&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;19. &lt;/span&gt;$car-&amp;gt;appendChild($engine);&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;20. &lt;/span&gt;&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;21. &lt;/span&gt;echo $dom-&amp;gt;saveXml();&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;22. &lt;/span&gt;?&amp;gt;&lt;/pre&gt;&lt;span class="CD_Code_Table_Footer"&gt;Hide line numbers &lt;/span&gt;&lt;input onclick="ToggleLineNumbers(this.checked, this.parentNode)" type="checkbox" /&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5958718683792590789-4924227538204068713?l=scriptdiaries.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scriptdiaries.blogspot.com/feeds/4924227538204068713/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5958718683792590789&amp;postID=4924227538204068713&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/4924227538204068713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/4924227538204068713'/><link rel='alternate' type='text/html' href='http://scriptdiaries.blogspot.com/2009/09/simple-php-dom-example.html' title='PHP DOM XML Example - Document Object Model'/><author><name>righteous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_tqP4IzwKwvc/SlFHxeKbpnI/AAAAAAAAAw4/-CCuJO61cyM/S220/righteousninja.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5958718683792590789.post-2659553770156753346</id><published>2009-09-21T05:00:00.000-07:00</published><updated>2009-12-20T15:06:52.007-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>Javascript - Get URL Parameters from Form Submit</title><content type='html'>This article has moved back to Code Diaries&lt;br /&gt;&lt;br /&gt;You can find it here &lt;a href="http://codediaries.blogspot.com/2009/11/javascript-get-url-parameters-from-form.html"&gt;Javascript - Get URL Parameters from Form Submit&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5958718683792590789-2659553770156753346?l=scriptdiaries.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scriptdiaries.blogspot.com/feeds/2659553770156753346/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5958718683792590789&amp;postID=2659553770156753346&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/2659553770156753346'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/2659553770156753346'/><link rel='alternate' type='text/html' href='http://scriptdiaries.blogspot.com/2009/09/javascript-get-url-parameters-from-form.html' title='Javascript - Get URL Parameters from Form Submit'/><author><name>righteous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_tqP4IzwKwvc/SlFHxeKbpnI/AAAAAAAAAw4/-CCuJO61cyM/S220/righteousninja.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5958718683792590789.post-6360291834584352251</id><published>2009-09-16T23:00:00.001-07:00</published><updated>2009-10-12T21:13:07.160-07:00</updated><title type='text'>Perl Basics - What You Really Need To Know</title><content type='html'>Once you know how to read from and write to a file, connect to a database and insert and retrieve records, use regular expressions&amp;nbsp;&amp;nbsp;and open a socket to a server and read and write data, you have covered 80% of what is really required to write most applications in perl.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://scriptdiaries.blogspot.com/2009/09/perl-socket-and-file-example.html"&gt;Perl Socket Example&lt;/a&gt;&lt;br /&gt;&lt;a href="http://scriptdiaries.blogspot.com/2009/09/perl-file-example.html"&gt;Perl File Example&lt;/a&gt;&lt;br /&gt;&lt;a href="http://scriptdiaries.blogspot.com/2009/09/perl-database-example.html"&gt;Perl Database Example&lt;/a&gt;&lt;br /&gt;Perl Regular Expression Example&lt;br /&gt;&lt;br /&gt;&lt;a href="http://scriptdiaries.blogspot.com/2009/10/creating-class-in-perl.html"&gt;Creating a class in Perl&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5958718683792590789-6360291834584352251?l=scriptdiaries.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scriptdiaries.blogspot.com/feeds/6360291834584352251/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5958718683792590789&amp;postID=6360291834584352251&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/6360291834584352251'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/6360291834584352251'/><link rel='alternate' type='text/html' href='http://scriptdiaries.blogspot.com/2009/09/perl-basics.html' title='Perl Basics - What You Really Need To Know'/><author><name>righteous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_tqP4IzwKwvc/SlFHxeKbpnI/AAAAAAAAAw4/-CCuJO61cyM/S220/righteousninja.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5958718683792590789.post-7040765460594935107</id><published>2009-09-16T22:04:00.001-07:00</published><updated>2009-10-09T03:01:50.754-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='example'/><category scheme='http://www.blogger.com/atom/ns#' term='file'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>Perl File Example</title><content type='html'>The aim of this simple example is to show how to read and write a file in Perl. This will read from a file trim the white space at the start and end and append the result to another file.&lt;br /&gt;&lt;br /&gt;First lets have a look at the example. It's really self explanatory.&lt;br /&gt;&lt;table class="CD_Code_Table" border="1"&gt;&lt;tr&gt;&lt;td&gt;&lt;pre id="xxpre" class="CD_Code_Words"&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 1. &lt;/span&gt;open (readfile, '&amp;lt;input.csv') or die "could not open file to read";&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 2. &lt;/span&gt;open (writefile, '&amp;gt;&amp;gt;output.csv') or die "could not open file to write";&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 3. &lt;/span&gt;while(&amp;lt;readfile&amp;gt;){&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 4. &lt;/span&gt;    #read from 'readfile', trim and write to 'writefile'&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 5. &lt;/span&gt;    $_ =~ s/(^ *| *$)//gi ;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 6. &lt;/span&gt;    print writefile $_;&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 7. &lt;/span&gt;}&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 8. &lt;/span&gt;close(readfile);&lt;br /&gt;&lt;span name="xxhid" class="CD_Code_Num"&gt; 9. &lt;/span&gt;close(sritefile);&lt;/pre&gt;&lt;span class="CD_Code_Table_Footer"&gt;Hide line numbers &lt;/span&gt;&lt;input type="checkbox" onclick="ToggleLineNumbers(this.checked, this.parentNode)" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5958718683792590789-7040765460594935107?l=scriptdiaries.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scriptdiaries.blogspot.com/feeds/7040765460594935107/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5958718683792590789&amp;postID=7040765460594935107&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/7040765460594935107'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/7040765460594935107'/><link rel='alternate' type='text/html' href='http://scriptdiaries.blogspot.com/2009/09/perl-file-example.html' title='Perl File Example'/><author><name>righteous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_tqP4IzwKwvc/SlFHxeKbpnI/AAAAAAAAAw4/-CCuJO61cyM/S220/righteousninja.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5958718683792590789.post-7706820879620050286</id><published>2009-09-16T21:49:00.001-07:00</published><updated>2009-12-20T15:14:34.238-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='example'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><category scheme='http://www.blogger.com/atom/ns#' term='database'/><title type='text'>Perl Database Example - ODBC DSN</title><content type='html'>This article has moved back to Code Diaries.&lt;br /&gt;&lt;br /&gt;You can read this at &lt;a href="http://codediaries.blogspot.com/2009/11/perl-database-example-using-odbc-data.html"&gt;Perl Database Example - ODBC DSN&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5958718683792590789-7706820879620050286?l=scriptdiaries.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scriptdiaries.blogspot.com/feeds/7706820879620050286/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5958718683792590789&amp;postID=7706820879620050286&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/7706820879620050286'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/7706820879620050286'/><link rel='alternate' type='text/html' href='http://scriptdiaries.blogspot.com/2009/09/perl-database-example.html' title='Perl Database Example - ODBC DSN'/><author><name>righteous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_tqP4IzwKwvc/SlFHxeKbpnI/AAAAAAAAAw4/-CCuJO61cyM/S220/righteousninja.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5958718683792590789.post-7469192081158786194</id><published>2009-09-06T17:14:00.000-07:00</published><updated>2009-12-20T15:12:40.578-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='socket'/><category scheme='http://www.blogger.com/atom/ns#' term='web crawler'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>How to Write a Simple Web and Image Crawler in Perl</title><content type='html'>This article has moved back to Code Diaries.&lt;br /&gt;&lt;br /&gt;You can read it at &lt;a href="http://codediaries.blogspot.com/2009/11/how-to-write-simple-recursive-web-and.html"&gt;How to Write a Simple Web and Image Crawler in Perl&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5958718683792590789-7469192081158786194?l=scriptdiaries.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scriptdiaries.blogspot.com/feeds/7469192081158786194/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5958718683792590789&amp;postID=7469192081158786194&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/7469192081158786194'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/7469192081158786194'/><link rel='alternate' type='text/html' href='http://scriptdiaries.blogspot.com/2009/09/how-to-write-simple-web-and-image.html' title='How to Write a Simple Web and Image Crawler in Perl'/><author><name>righteous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_tqP4IzwKwvc/SlFHxeKbpnI/AAAAAAAAAw4/-CCuJO61cyM/S220/righteousninja.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5958718683792590789.post-3500269062700558822</id><published>2009-09-06T17:12:00.001-07:00</published><updated>2009-10-09T03:09:44.703-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='example'/><category scheme='http://www.blogger.com/atom/ns#' term='socket'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>Perl Socket Example</title><content type='html'>The aim of this tutorial is to show how to read and write a socket in Perl. We will open a socket to a website, write the request headers, read the response and write the response to the console. You do not need any prior HTTP 1.x knowledge.&lt;br /&gt;&lt;br /&gt;First lets have a look at the example. It's really self explanatory.&lt;br /&gt;&lt;table border="1" class="CD_Code_Table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;pre class="CD_Code_Words" id="xxpre"&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt; 1. &lt;/span&gt;    use IO::Socket;&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt; 2. &lt;/span&gt;&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt; 3. &lt;/span&gt;    my $sock = new IO::Socket::INET (PeerAddr =&amp;gt; 'localhost',&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt; 4. &lt;/span&gt;                                        PeerPort =&amp;gt; 8080, &lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt; 5. &lt;/span&gt;                                        Proto =&amp;gt; 'tcp');&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt; 6. &lt;/span&gt;    die "could not create socket: $!\n" unless $sock;                                        &lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt; 7. &lt;/span&gt;    &lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt; 8. &lt;/span&gt;    printf $sock ("GET / HTTP/1.0\n");&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt; 9. &lt;/span&gt;    printf $sock ("Host: localhost\n");&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;10. &lt;/span&gt;    printf $sock ("Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;11. &lt;/span&gt;    printf $sock ("User-Agent: Mozilla/5\n");&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;12. &lt;/span&gt;    printf $sock ("Connection: keepalive\n");&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;13. &lt;/span&gt;    printf $sock ("\n\n");&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;14. &lt;/span&gt;    &lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;15. &lt;/span&gt;    while (&amp;lt;$sock&amp;gt;) {&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;16. &lt;/span&gt;        if($_=~ m/validate_response/i) {&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;17. &lt;/span&gt;             last;&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;18. &lt;/span&gt;        }&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;19. &lt;/span&gt;         else{&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;20. &lt;/span&gt;             print $_;&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;21. &lt;/span&gt;        }&lt;br /&gt;&lt;span class="CD_Code_Num" name="xxhid"&gt;22. &lt;/span&gt;    }&lt;/pre&gt;&lt;span class="CD_Code_Table_Footer"&gt;Hide line numbers &lt;/span&gt;&lt;input onclick="ToggleLineNumbers(this.checked, this.parentNode)" type="checkbox" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Line 3&lt;/strong&gt; We open the socket to localhost on port 8080. This is where my server tomcat ususally runs. But you can change this to anything&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Lines 8-13&lt;/strong&gt; Here we write out the reust HEADER&amp;nbsp;to the webserver. Just remember if you change your host from 'localhost' to something else, you need to change line 9 to reflect that too.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Lines&amp;nbsp;15-22&lt;/strong&gt; Read the response from the webserver and write it to the screen.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5958718683792590789-3500269062700558822?l=scriptdiaries.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scriptdiaries.blogspot.com/feeds/3500269062700558822/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5958718683792590789&amp;postID=3500269062700558822&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/3500269062700558822'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/3500269062700558822'/><link rel='alternate' type='text/html' href='http://scriptdiaries.blogspot.com/2009/09/perl-socket-and-file-example.html' title='Perl Socket Example'/><author><name>righteous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_tqP4IzwKwvc/SlFHxeKbpnI/AAAAAAAAAw4/-CCuJO61cyM/S220/righteousninja.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5958718683792590789.post-7706349818959624063</id><published>2009-07-27T20:04:00.000-07:00</published><updated>2009-11-09T18:45:20.280-08:00</updated><title type='text'>mainpage</title><content type='html'>&lt;a href="http://www.dmegs.com" rel="nofollow"&gt;Dmegs Web Directory&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.addsitelink.com/" rel="nofollow"&gt;Add Link - Suggest Link - Submit URL Directory&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a rel="nofollow" href="http://www.phastnet.com"&gt;Reliable web site hosting service&lt;/a&gt; - Reliable web hosting service designed for small business web sites, scalable for growth with reliable customer service. &lt;br /&gt;&lt;br /&gt;&lt;a rel="nofollow" href="http://www.brainpulse.com/search_engine_promotion_india/search_engine_promotion_india.php"&gt;&lt;b&gt;SEO Services : Search Engine Optimization&lt;/b&gt;&lt;/a&gt; - BrainPulse one of the foremost Indian SEO Company offers quality Search Engine &lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.linkaddurl.com/" rel="nofollow"&gt;LINK ADD URL Seo Friendly Web Directory&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.webhostingjack.in/" rel="nofollow"&gt;Hosting India&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.signcompatibilityhoroscope.com/" rel="nofollow"&gt;Love Horoscopes, Astrology Compatibility&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5958718683792590789-7706349818959624063?l=scriptdiaries.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scriptdiaries.blogspot.com/feeds/7706349818959624063/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5958718683792590789&amp;postID=7706349818959624063&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/7706349818959624063'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5958718683792590789/posts/default/7706349818959624063'/><link rel='alternate' type='text/html' href='http://scriptdiaries.blogspot.com/2009/09/mainpage.html' title='mainpage'/><author><name>righteous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_tqP4IzwKwvc/SlFHxeKbpnI/AAAAAAAAAw4/-CCuJO61cyM/S220/righteousninja.JPG'/></author><thr:total>0</thr:total></entry></feed>
