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

<channel>
	<title>Burad&#039;s Blog &#187; javascript</title>
	<atom:link href="http://www.aburad.com/blog/tag/javascript/feed" rel="self" type="application/rss+xml" />
	<link>http://www.aburad.com/blog</link>
	<description>A computer nerd who would soon be an MBA</description>
	<lastBuildDate>Thu, 28 Oct 2010 15:53:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
		<item>
		<title>Perfect password according to firefox</title>
		<link>http://www.aburad.com/blog/2008/05/perfect-password-according-to-firefox.html</link>
		<comments>http://www.aburad.com/blog/2008/05/perfect-password-according-to-firefox.html#comments</comments>
		<pubDate>Sat, 03 May 2008 21:03:02 +0000</pubDate>
		<dc:creator>burad</dc:creator>
				<category><![CDATA[firefox]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://aburad.com/blog/?p=223</guid>
		<description><![CDATA[I was going through bits of firefox code, and I found the algorithm used by firefox to measure password strength. You can find it in function setPasswordStrength() in this file : chrome://mozapps/content/preferences/changemp.js. So point schema for password strength: For length :       password-length*10 &#8211; 20   (Max 30) For Numbers:    no-of-numerics * 10       [...]]]></description>
			<content:encoded><![CDATA[<p>I was going through bits of firefox code, and I found the algorithm used by firefox to measure password strength. You can find it in function <em>setPasswordStrength()</em> in this file : <a href="chrome://mozapps/content/preferences/changemp.js">chrome://mozapps/content/preferences/changemp.js</a>.<br />
So point schema for password strength:</p>
<blockquote><p><strong>For length :               password-length*10 &#8211; 20   (Max 30)<br />
For Numbers:         no-of-numerics * 10          (Max 30)<br />
For Symbols:           no-of-symbols * 15           (Max 45)<br />
For UpperCase:   no-of-Uppercase * 10        (Max 30)</strong></p></blockquote>
<p>Your password strength is sum of all these points. So smallest password that would get 100 on password meter can be : AAA@@@  or something similar. But there should also be some criterion for the <strong>uniqueness of the characters. </strong></p>
<p>Interesting read-on <a href="http://www.cs.cmu.edu/~help/security/choosing_passwords.html">how to choose good passwords.</a> that are also easy to remember. Please share your tips on choosing passwords [but yeah dont share passwords <img src='http://www.aburad.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ]</p>
<p><em>Extra Cookie</em>:<br />
Type <a href="resource:">resource:</a> in your location bar to directly go to firefox installation directory.</p>
<p>Related:<br />
<a href="http://aburad.com/blog/2006/07/choose-and-remember-great-passwords.html">Choose and remember great passwords.</a><br />
<a href="http://aburad.com/blog/2007/01/firefox-about-pages.html">Firefox about pages</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.aburad.com/blog/2008/05/perfect-password-according-to-firefox.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>View page source trick in firefox, flock</title>
		<link>http://www.aburad.com/blog/2008/04/view-page-source-trick-in-firefox-flock.html</link>
		<comments>http://www.aburad.com/blog/2008/04/view-page-source-trick-in-firefox-flock.html#comments</comments>
		<pubDate>Tue, 15 Apr 2008 18:07:39 +0000</pubDate>
		<dc:creator>burad</dc:creator>
				<category><![CDATA[firefox]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://aburad.com/blog/2008/04/15/view-page-source-trick-in-firefox-flock/</guid>
		<description><![CDATA[You may have read about firefox&#8217;s special about: pages like about:config, about:cache etc. Or you can go through Firefox about: pages to have an idea about them. There is one similar functionality in firefox which allows you to view page source of a page. You can type view-source:http://www.google.com/ this in location bar to view page [...]]]></description>
			<content:encoded><![CDATA[<p>You may have read about firefox&#8217;s special <span style="font-style: italic">about: </span>pages like <span style="font-style: italic">about:config, about:cache</span> etc. Or you can go through <a href="http://aburad.com/blog/2007/01/firefox-about-pages.html">Firefox about: pages</a> to have an idea about them. There is one similar functionality in firefox which allows you to view page source of a page. You can type<br />
<a style="font-weight: bold" href="view-source://http//www.google.com/"></a></p>
<blockquote><p><a style="font-weight: bold" href="view-source://http//www.google.com/">view-source:http://www.google.com/ </a></p></blockquote>
<p>this in location bar to view page source of google.com.<br />
So i have made this Bookmarklet to view page source: <a href="javascript:window.open('view-source:'+top.location)=0;">View Source</a> (So you can drag this to your bookmark toolbar to have quick access).</p>
<p>Similarly you can type<span style="font-weight: bold"> </span><a style="font-weight: bold" href="javascript:">javascript:</a> in your location bar to open java script error console.</p>
<p>Update1:<br />
Key Board Shortcut: Use Ctrl+U to view page source</p>
<p>Related Post:<br />
<a href="http://aburad.com/blog/2007/01/firefox-about-pages.html">Firefox About Pages</a><br />
<a href="http://aburad.com/blog/2006/03/little-tweaks-with-javascript-bookmarklets.html">Little tweaks with javascript : Bookmarklets.</a><br />
<a href="http://aburad.com/blog/2007/04/open-webpages-in-sidebar.html">Open webpages in sidebar</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.aburad.com/blog/2008/04/view-page-source-trick-in-firefox-flock.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>My Del.icio.us Toolbar 2.0</title>
		<link>http://www.aburad.com/blog/2008/04/my-delicious-toolbar-20.html</link>
		<comments>http://www.aburad.com/blog/2008/04/my-delicious-toolbar-20.html#comments</comments>
		<pubDate>Tue, 15 Apr 2008 17:55:44 +0000</pubDate>
		<dc:creator>burad</dc:creator>
				<category><![CDATA[firefox]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[delicious]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://aburad.com/blog/2008/04/15/my-delicious-toolbar-20/</guid>
		<description><![CDATA[Yesterday I was working late night till 3AM, to update my extension &#8216;My Del.icio.us Toolbar&#8217; which I made long back in October 2006. Reason was to make it work for newer versions of firefox. But then I added some new features too : I added a Explore feature which is similar to Stumble. Checking Del.icio.us [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I was working late night till 3AM, to update my extension &#8216;My Del.icio.us Toolbar&#8217; which I made <a href="http://aburad.com/blog/2006/10/my-delicious-toolbar.html">long back in October 2006</a>. Reason was to make it work for newer versions of firefox. But then I added some new features too :</p>
<ul>
<li>I added a <span style="font-style: italic">Explore </span>feature which is similar to Stumble.</li>
<li>Checking Del.icio.us cookies to verify authentication. (You can find more details on how to read browser cookies from javascript <a href="http://developer.mozilla.org/en/docs/XUL_Tutorial:XPCOM_Examples">here</a>. Actually It uses <code><a rel="nofollow" href="http://xulplanet.com/references/xpcomref/ifaces/nsICookieManager.html" title="http://xulplanet.com/references/xpcomref/ifaces/nsICookieManager.html" class="external text">nsICookieManager</a></code> interface to iterate over all of the cookies.</li>
</ul>
<p>Try <a href="https://addons.mozilla.org/en-US/firefox/addon/6997">My Del.icio.us 2.0</a> (Right now you may have to login to access the extension as it&#8217;s in Sandbox.)<a href="http://bp1.blogger.com/_qhHaEAh26gI/SABxNyu8MlI/AAAAAAAAAQ0/f-Vj7Lxb33Y/s1600-h/delicious1.png"><img border="0" src="http://bp1.blogger.com/_qhHaEAh26gI/SABxNyu8MlI/AAAAAAAAAQ0/f-Vj7Lxb33Y/s320/delicious1.png" style="display: block; margin: 0px auto 10px; cursor: pointer; text-align: center" id="BLOGGER_PHOTO_ID_5188271252501705298" /></a></p>
<p>I also noticed that mozilla has redesigned the extension page. They have also added a nice statistics Dashboard for extension, provided graphical representation of number of downloads, active daily users etc. I was surprised to see that <a href="https://addons.mozilla.org/en-US/firefox/addon/3540">older version of My Del.icio.us</a> has reached a total download of 11,200 (not that a big number but still surprising for me) and number of active user around 1000.<br />
<a href="http://bp1.blogger.com/_qhHaEAh26gI/SAByByu8MmI/AAAAAAAAAQ8/ZzafgkL0GHQ/s1600-h/deliciousstats.png"><img border="0" src="http://bp1.blogger.com/_qhHaEAh26gI/SAByByu8MmI/AAAAAAAAAQ8/ZzafgkL0GHQ/s320/deliciousstats.png" style="display: block; margin: 0px auto 10px; cursor: pointer; text-align: center" /></a><br />
Try <a href="https://addons.mozilla.org/en-US/firefox/addon/6997">My Del.icio.us 2.0</a> and provide feedback.</p>
<p>Also Try: <a href="http://www.aburad.com/delicious/searcher/index.html">Del.icio.us Search<span style="font-style: italic">ER</span></a><br />
Related Post:</p>
<ul>
<li><a href="http://aburad.com/blog/2006/10/if-you-want-to-develop-firefox-extension.html">If you want to develop firefox extension..</a></li>
<li><a href="http://aburad.com/blog/2007/01/firefox-about-pages.html">Firefox about: pages</a></li>
<li><a href="http://aburad.com/blog/2008/02/more-firefox-shortcuts.html">Firefox shortcuts</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.aburad.com/blog/2008/04/my-delicious-toolbar-20.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adobe AIR: Web to Desktop</title>
		<link>http://www.aburad.com/blog/2008/02/adobe-air-web-to-desktop.html</link>
		<comments>http://www.aburad.com/blog/2008/02/adobe-air-web-to-desktop.html#comments</comments>
		<pubDate>Tue, 19 Feb 2008 21:28:44 +0000</pubDate>
		<dc:creator>burad</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[webdev]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[rubik]]></category>

		<guid isPermaLink="false">http://aburad.com/blog/?p=212</guid>
		<description><![CDATA[Past few days, I have came across Adobe AIR through digg, techmeme, delicious and so today i thought i should try this. Adobe AIR lets us their existing web development skills in HTML, AJAX, Flash and Flex to build and deploy rich Internet applications to the desktop. For Application development you will need two things: [...]]]></description>
			<content:encoded><![CDATA[<p>Past few days, I have came across Adobe AIR through digg, techmeme, delicious and so today i thought i should try this. Adobe AIR lets us their existing web development skills in HTML, AJAX, Flash and Flex to build and deploy rich Internet applications to the desktop. For Application development you will need two things:</p>
<ul>
<li><a href="http://labs.adobe.com/downloads/air.html" title="Adobe AIR Runtime">Adobe AIR Runtime</a> : Necessary for running AIR applications. (For windows &amp; mac)</li>
<li><a href="http://labs.adobe.com/downloads/airsdk.html" title="AIR_SDK">AIR_SDK</a> Provide necessary libraries to build AIR application</li>
</ul>
<p>Having <a href="http://labs.adobe.com/wiki/index.php/AIR:Dreamweaver_CS3_Extension">Adobe AIR extension for Dreamweaver CS3</a> can be very helpful as it facilitates to package and preview .air application files directly within Adobe Dreamweaver CS3.</p>
<p>As my first AIR application, I ported my <a href="http://www.aburad.com/cubing/timer.html" title="Rubik Cube Timer">rubiks cube timer</a> as a desktop application (<a href="http://www.aburad.com/cubing/RubikTimer.air" title="RubikTimer">RubikTimer.air</a>). Its very easy using dreamweaver extension, have a look here : <a href="http://livedocs.adobe.com/labs/air/1/devappshtml/help.html?content=HTMLHelloWorld_1.html">Create your first HTML-based AIR application with the AIR SDK </a>(great tutorial for beginners).</p>
<p>One problem I faced: Usually <em>setInterval(&#8220;display()&#8221;,500)</em> works with Firefox/IE but it was not starting with no error message to look into but then i found out about using Adobe CommandLine tool. (via <a href="http://www.blog.mediaprojekte.de/tutorials/three-ways-to-debug-an-adobe-air-javascript-application/">Three ways to debug Adobe javascript Application</a>). It´s called ADL and resides in the /bin folder of the SDK. ADL showed the Error: &#8220;Unsafe javascript&#8221;. Then after some random changes when i change it to <em>&#8220;setInterval(display,500)&#8221;</em>, It started working. Another problem I faced was related to <em>keypress events in javascript</em>, were not working with AIR (still have to resolve this issue)</p>
<p>Download <a href="http://www.aburad.com/cubing/RubikTimer.air">RubikTimer.air here</a><br />
Web Based <a href="http://www.aburad.com/cubing/timer.html">Rubik Cube Timer</a></p>
<p>Related Post:</p>
<p><a href="http://labs.adobe.com/technologies/air/samples/">Sample Adobe AIR Applications</a><a rel="bookmark" href="http://aburad.com/blog/2008/02/trying-hands-on-google-gadgets.html" title="Permanent Link to Trying hands on Google gadgets"><br />
Trying hands on Google gadgets</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.aburad.com/blog/2008/02/adobe-air-web-to-desktop.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Trying hands on Google gadgets</title>
		<link>http://www.aburad.com/blog/2008/02/trying-hands-on-google-gadgets.html</link>
		<comments>http://www.aburad.com/blog/2008/02/trying-hands-on-google-gadgets.html#comments</comments>
		<pubDate>Sun, 17 Feb 2008 00:16:26 +0000</pubDate>
		<dc:creator>burad</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[webdev]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[rubik]]></category>

		<guid isPermaLink="false">http://aburad.com/blog/?p=211</guid>
		<description><![CDATA[Tonight i tried creating some google gadgets (actually its quite easy using Google Gadget Creator). You can check out them here: Google gadgets . You can use html / javascript (as in any other webapage) to create gadgets. So i converted my Rubiks Cube Timer to a gadget. Other one is a gadget to search [...]]]></description>
			<content:encoded><![CDATA[<p>Tonight i tried creating some google gadgets (actually its quite easy using <a href="http://code.google.com/apis/gadgets/docs/gs.html#GGE" title="Google Gadget Creator">Google Gadget Creator</a>).  You can check out them here: <a href="http://www.aburad.com/googlegadget.html">Google gadgets </a>. You can use html / javascript (as in any other webapage) to create gadgets.<img src="http://aburad.com/cubing/rubiktimergadget.png" alt="Rubik timer gadget" align="left" height="196" hspace="5" vspace="5" width="263" /> So i converted my <a href="http://www.aburad.com/cubing/timer.html" title="Rubik Cube Timer">Rubiks Cube Timer</a> to  a <a href="http://fusion.google.com/ig/add?synd=open&amp;source=ggyp&amp;moduleurl=http://burad-gadgets.googlecode.com/files/rubikcubetimer-gadget.xml" title="gadget" target="_blank">gadget</a>. Other  one is a gadget to search stock, scripts on bombay stock exchange.</p>
<p>You can also create gadgets using : <a href="http://www.google.com/ig/gmchoices" title="Make your own Gadget">Make your Own Gadget</a> (Which is as simple as filling out forms)</p>
<p>P.S. : My first post on wordpress blog. (I imported my previous posts from <a href="http://burad.blogspot.com" title="blogger">blogger</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aburad.com/blog/2008/02/trying-hands-on-google-gadgets.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Open webpages in sidebar</title>
		<link>http://www.aburad.com/blog/2007/04/open-webpages-in-sidebar.html</link>
		<comments>http://www.aburad.com/blog/2007/04/open-webpages-in-sidebar.html#comments</comments>
		<pubDate>Tue, 03 Apr 2007 09:52:00 +0000</pubDate>
		<dc:creator>burad</dc:creator>
				<category><![CDATA[firefox]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[gtalk]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://aburad.com/blog/?p=197</guid>
		<description><![CDATA[Yesterday i found this great way to store some imp bookmarks in your sidebar. And you can create different sidebar for each such collection. Like for my bookmarks click here. Now you can save this bookmark (may be in bookmark toolbar folder) and use it. This link is a javascript : javascript:window.sidebar.addPanel('title of sidebar','url of [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday i found this great way to store some imp bookmarks in your sidebar. And you can create different sidebar for each such collection. Like for my bookmarks <a href="javascript:window.sidebar.addPanel('Burad\'s%20Links','http://www.aburad.com/firefox/sidebar.html','');">click here.</a><br />
Now you can save this bookmark (may be in bookmark toolbar folder) and use it.</p>
<p>This link is a javascript :</p>
<p><code>javascript:window.sidebar.addPanel('title of sidebar','url of sidebar panel','');</code></p>
<p>So now you can point to any URL. and that URL will open in  sidebar with given title.<br />
atleast Works with Firefox</p>
<p style="text-align: center"><a href="http://bp1.blogger.com/_qhHaEAh26gI/RhIolvwvkDI/AAAAAAAAAG0/axEmuEDdxco/s1600-h/sidebar.png" ><img src="http://bp1.blogger.com/_qhHaEAh26gI/RhIolvwvkDI/AAAAAAAAAG0/axEmuEDdxco/s320/sidebar.png" style="cursor: pointer; width: 289px; height: 291px" id="BLOGGER_PHOTO_ID_5049142761176928306" border="0" /></a></p>
<p>Update: <a href="http://labnol.blogspot.com/2007/03/run-google-talk-in-firefox-sidebar.html">Run google talk in firefox sidebar</a></p>
<p>A bookmarklet to bookmark websites to open in sidebar. <a href="javascript:function ab(){a=prompt(&quot;Enter title of URL&quot;); if (a){b = prompt(&quot;Enter URL&quot;,&quot;http://&quot;); if(b){window.sidebar.addPanel(a,b,''); }}} ab();">click here</a></p>
<p>You can click here: <a href="javascript:window.sidebar.addPanel('Gchat','http://talkgadget.google.com/talkgadget/client','');">Add google chat to sidebar</a><br />
Add <a href="javascript:window.sidebar.addPanel('Digg|River','http://www.diggriver.com/','');">Digg|River</a><br />
<b>Update: 25-apr-2008</b><br />
Add <a href="javascript:window.sidebar.addPanel('Facebook Chat','http://www.facebook.com/presence/popout.php','');">Facebook Chat</a></p>
<p>Also read : <a href="http://kshitijb.blogspot.com/2007/04/webpages-for-sidebar.html">Webpages for Sidebar</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.aburad.com/blog/2007/04/open-webpages-in-sidebar.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Play with html using javascript</title>
		<link>http://www.aburad.com/blog/2007/02/play-with-html-using-javascript.html</link>
		<comments>http://www.aburad.com/blog/2007/02/play-with-html-using-javascript.html#comments</comments>
		<pubDate>Sun, 11 Feb 2007 18:59:00 +0000</pubDate>
		<dc:creator>burad</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[web2.0]]></category>
		<category><![CDATA[webdev]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[gif]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://aburad.com/blog/?p=180</guid>
		<description><![CDATA[Javascipt can be very fruitful and flexible when it comes to modifying webapges dynamically (though client side). Javascript can be helpful in creating response to browser events like mouseup, mouseover etc, veryfying of form values prior to submitting them, changing style and value of html elements dynamically. Examples i disscuss here are being user by [...]]]></description>
			<content:encoded><![CDATA[<p>Javascipt can be very fruitful and flexible when it comes to modifying webapges dynamically (though client side). Javascript can be helpful in creating response to browser events like mouseup, mouseover etc, veryfying of form values prior to submitting them, changing style and value of html elements dynamically.<br />
Examples i disscuss here are being user by me in developing <a href="http://aburad.com/blog/2007/02/paint-chat.html">Paint Chat !!</a> So here I go..<br />
You can write javascript functions and code in section as:</p>
<blockquote>
<pre><code>&lt;script type="text/javascript"&gt;function test(){alert("test javascript");}&lt;/script&gt;</code></pre>
</blockquote>
<p><span style="font-style: italic"></span></p>
<h4>Action on events:</h4>
<p>Example of events can be mouseclick, keystroke, submitting form etc.<br />
With <span style="font-style: italic">onload()</span></p>
<blockquote>
<pre><code> &lt;body onload="init()"&gt;</code></pre>
</blockquote>
<p>Now <span style="font-style: italic">init()</span> function will be called when this html page is being loaded.<br />
For links, javascript function can be evoked when clicking, mouseover over links like</p>
<blockquote>
<pre><code> &lt;a href="javascript:replay()" mce_href="javascript:replay()"&gt;Refresh ! &lt;/a&gt;</code></pre>
</blockquote>
<p>Now function <span style="font-style: italic">replay()</span> will be called when Refresh! is clicked. For input text box</p>
<blockquote>
<pre><code>&lt;input type="text" size="30" id="search" onchange="suggest()"&gt;; </code></pre>
</blockquote>
<p>Now whenever content of textbox changes the function <span style="font-style: italic">suggest()</span> will be called. It can be useful when feature like google suggest has to be implemented or so.</p>
<p>On submitting forms:</p>
<blockquote>
<pre><code>&lt;form method="post" action="some.php" onsubmit="return checkForm()"&gt;</code></pre>
</blockquote>
<p>So whenever this form is being submitted <span style="font-style: italic">checkForm()</span> function will be called and can be helpful in verifying values of form elements.</p>
<p>onMouseOver and onMouseOut:</p>
<blockquote>
<pre><code>&lt;a href="http://www.aburad.com/blog" mce_href="http://www.aburad.com/blog" onmouseover="fade()"&gt;&lt;img src="image.gif" mce_src="image.gif"&gt; &lt;/a&gt;</code></pre>
</blockquote>
<p>Now when mouse is over image <span style="font-style: italic">fade()</span> function will be called and can be used for animate and styling purposes.<br />
<span style="font-style: italic"></span></p>
<h4>Registering of events</h4>
<p>A simple way can be:<br />
Conside the html code : <code>&lt;div id="sample"&gt; ..... some... html..text.. &lt;/div&gt; </code><br />
Now using javascript you can register event for this div by:</p>
<blockquote>
<pre><code> var div_sample = document.getElementById('sample');div_sample.onmousedown=sampleMouseDown ; </code></pre>
</blockquote>
<p>Now whenever mouseover ocours over this div html element <span style="font-style: italic">sampleMouseDown()</span> function will be called. Events can also be registered using <span style="font-style: italic">addEventListener() </span>. Find more information baout it here:<a href="http://www.quirksmode.org/js/events_advanced.html">Advanced event registration models</a><span style="font-style: italic"></span></p>
<h4>Modify Style and values for html elements</h4>
<p>Within some javascript function, you can first get the element object by <span style="font-style: italic">getElementByID()</span> <span style="font-style: italic">getElementsByName()</span> for example conside the javascript code:</p>
<blockquote><p><code>document.getElementById("colorcode").innerHTML = "#000000";<br />
document.getElementById("bgtest").style.backgroundColor= "green";<br />
</code></p></blockquote>
<p>The first line find the html element with id <span style="font-style: italic">colorcode</span> and then set its value to &#8220;#000000&#8243; using <span style="font-style: italic">innerHTML</span>. In second line, it sets the background of html element with id &#8220;bgtest&#8221; to green.</p>
<p><span style="font-weight: bold">Some other tweaks which were useful :</span></p>
<ul>
<li>Calling some function repeatedly with some time interval, consider javascript code:</li>
</ul>
<blockquote><p><code>var intervalID = setInterval(drawCurve, 100);<br />
</code></p></blockquote>
<p>So the drawCurve() function will be called repeatedly after 100ms. You can cancel this process( removing repeatedly calling) by <code>clearInterval(intervalID);</code></p>
<ul>
<li>You can use <code>setTimeout(drawCurve,100)</code> function to delay <span style="font-style: italic">drawCurve()</span> execution for a specified time period(100ms).</li>
</ul>
<ul>
<li>Calling a php function inside javascript:</li>
</ul>
<blockquote><p><code>var testImg = new Image();<br />
testImg.src="form.php?name=form_value" mce_src="form.php?name=form_value";<br />
</code></p></blockquote>
<p>Now here in <span style="font-style: italic">form.php</span> you can fetch value of variable <span style="font-style: italic">name</span> using <span style="font-weight: bold">$_GET</span> and can perform appropriate action.</p>
<p><span style="font-weight: bold">Some links:</span></p>
<ul>
<li><a href="http://www.w3schools.com/js/js_examples.asp">W3Schools: Javascript Examples</a></li>
<li><a href="http://developer.mozilla.org/en/docs/JavaScript">MDC: Javascript</a></li>
<li><a href="http://www.alistapart.com/articles/domtricks2/">DOM Design Tricks</a></li>
<li><a href="http://www.quirksmode.org/js/events_events.html">The events</a></li>
<li><a href="http://particletree.com/features/javascript-basics-for-prototyping/">Javascript Basic for Prototyping</a></li>
</ul>
<p><span style="font-weight: bold">Related Posts:</span></p>
<ul>
<li><a href="http://aburad.com/blog/2006/03/little-tweaks-with-javascript-bookmarklets.html">Little tweaks with javascript : Bookmarklets.</a></li>
<li><a href="http://aburad.com/blog/2006/10/if-you-want-to-develop-firefox-extension.html">If you want to develop firefox extension..</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.aburad.com/blog/2007/02/play-with-html-using-javascript.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>funky javascript</title>
		<link>http://www.aburad.com/blog/2006/10/funky-javascript.html</link>
		<comments>http://www.aburad.com/blog/2006/10/funky-javascript.html#comments</comments>
		<pubDate>Sun, 08 Oct 2006 06:38:00 +0000</pubDate>
		<dc:creator>burad</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://aburad.com/blog/?p=141</guid>
		<description><![CDATA[Just paste the JavaScript given in you address bar after visiting any website. Copy this to location bar &#38; press enter. &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; DI=document.getElementsByTagName(&#8220;img&#8221;); DIL=DI.length; function A(){for(i=0; i-DIL; i++){DIS=DI[ i ].style; DIS.position=&#8217;absolute&#8217;; DIS.left=(Math.sin(R*x1+i*x2+x3)*x4+x5)+&#8221;px&#8221;; DIS.top=(Math.cos(R*y1+i*y2+y3)*y4+y5)+&#8221;px&#8221;}R++}setInterval(&#8216;A()&#8217;,5); void(0); &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; This is what you get when you try it [...]]]></description>
			<content:encoded><![CDATA[<p>Just paste the JavaScript given in you address bar after visiting any website.<br />
Copy this to location bar &amp; press enter.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; DI=document.getElementsByTagName(&#8220;img&#8221;); DIL=DI.length; function A(){for(i=0; i-DIL; i++){DIS=DI[ i ].style; DIS.position=&#8217;absolute&#8217;; DIS.left=(Math.sin(R*x1+i*x2+x3)*x4+x5)+&#8221;px&#8221;; DIS.top=(Math.cos(R*y1+i*y2+y3)*y4+y5)+&#8221;px&#8221;}R++}setInterval(&#8216;A()&#8217;,5); void(0);<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
This is what you get when you try it on search result from google images:<br />
<a href="http://photos1.blogger.com/blogger/197/560/1600/a.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img src="http://photos1.blogger.com/blogger/197/560/320/a.png" style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 404px; height: 243px" border="0" /></a></p>
<p>Related Links : <a href="http://aburad.com/blog/2007/02/play-with-html-using-javascript.html">Play with html using javascript</a><br />
<a href="http://aburad.com/blog/2006/03/little-tweaks-with-javascript-bookmarklets.html">Little tweaks with javascript bookmarklet</a></p>
<p>Source : <a href="http://digg.com/programming/Funky_JavaScript_works_on_all_websites_even_digg">Digg.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.aburad.com/blog/2006/10/funky-javascript.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

