<?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>Ankit Jain &#187; javascript</title>
	<atom:link href="http://ankitjain.info/ankit/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://ankitjain.info/ankit</link>
	<description>» It’s all about Ankit and Web! «</description>
	<lastBuildDate>Thu, 02 Jun 2011 16:54:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>ProxySwitcher &#8211; My First Firefox Extension</title>
		<link>http://ankitjain.info/ankit/2010/01/10/iitk-proxy-switcher/</link>
		<comments>http://ankitjain.info/ankit/2010/01/10/iitk-proxy-switcher/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 12:29:14 +0000</pubDate>
		<dc:creator>Ankit</dc:creator>
				<category><![CDATA[Programming/Code]]></category>
		<category><![CDATA[Quick Tricks]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[proxy-server]]></category>

		<guid isPermaLink="false">http://ankitjain.info/ankit/?p=354</guid>
		<description><![CDATA[At IITK we have two Internet proxy-servers. Sometimes, one server goes down and we are required to switch to another by navigating to Tools > Options > Advanced > Network > Settings. With Firefox, I tried to simplify this effort with following extension &#8211; one click proxy switcher! Once installed, you will see IITK&#8217;s Proxy [...]]]></description>
			<content:encoded><![CDATA[<p>At IITK we have two Internet proxy-servers. Sometimes, one server goes down and we are required to switch to another by navigating to Tools > Options > Advanced > Network > Settings. With Firefox, I tried to simplify this effort with following extension &#8211; <em>one click proxy switcher</em>!<br />
<center><br />
<a title="Download - One Click Proxy Switcher" jsinstallmethod="browser_app_addon_install"  href="/ankit/wp-content/proxyswitcher.xpi"><img src="/ankit/wp-content/addtoFirefox.png"/></a><br />
</center></p>
<p>Once installed, you will see <strong>IITK&#8217;s Proxy Switcher</strong> in Tools menu. This extension switches between <u><em>direct connection</em>, <em>bsnlproxy</em> and <em>vsnlproxy</em></u>. It only modifies server-address and leaves PORT number as it is.<br />
<span id="more-354"></span><br />
<center><br />
<img src="/ankit/wp-content/proxy-switcher.png" alt="tools-menu-proxy-sqwitcher" /><br />
</center></p>
<p><small>* This software/extension is provided &#8220;as is&#8221; and without any warranty or support. The author will not be liable for data loss, damages or any other kind of loss while using or misusing this software. The extension is FREE and copy left.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://ankitjain.info/ankit/2010/01/10/iitk-proxy-switcher/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fun with Yahoo Media Player!</title>
		<link>http://ankitjain.info/ankit/2009/02/08/how-yahoo-media-player-poadcast-works/</link>
		<comments>http://ankitjain.info/ankit/2009/02/08/how-yahoo-media-player-poadcast-works/#comments</comments>
		<pubDate>Sun, 08 Feb 2009 17:43:35 +0000</pubDate>
		<dc:creator>Ankit</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Product Review]]></category>
		<category><![CDATA[Programming/Code]]></category>
		<category><![CDATA[flash player]]></category>
		<category><![CDATA[how it works]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[tool]]></category>
		<category><![CDATA[yahoo]]></category>

		<guid isPermaLink="false">http://ankitjain.info/ankit/?p=214</guid>
		<description><![CDATA[A quick way to insert music in your site: Create hyper-links for few MP3 files Insert following script code to your page &#60;script type="text/javascript" src="http://mediaplayer.yahoo.com/js"&#62;&#60;/script&#62; You are done! Yahoo! Media Player will be loaded and it will make all media links clickable Here are few of my favorite tracks. Use the play button to listen. [...]]]></description>
			<content:encoded><![CDATA[<p>A quick way to insert music in your site:</p>
<ol>
<li>Create hyper-links for few MP3 files</li>
<li>Insert following script code to your page<br />
<code>&lt;script type="text/javascript" src="http://mediaplayer.yahoo.com/js"&gt;&lt;/script&gt;</code></li>
<li>You are done! Yahoo! Media Player will be loaded and it will make all media links clickable <img src='http://ankitjain.info/ankit/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ol>
<p>Here are few of my favorite tracks. Use the play button to listen. <small>Thanks to <a href="http://www.radioreloaded.com" target="_blank">RadioReloaded.com</a></small>.</p>
<ol> <a href="http://braikhna.com/music/Tere%20Naina.mp3">Tere Naina, Chandi Chowk To China (2009)</a><br />
<a href="http://www.radioreloaded.com/audio/2k/1038_Jaane Kyun Log Pyaar Kerte Hain.mp3">Jaane Kyun Log Pyar Karte Hein, Dil Chahta Hai (2001)</a><br />
<a href="http://www.radioreloaded.com/audio/7k/6724_Akela Hoon Main.mp3">Akela hoon Mein, Raeth</a><br />
<a href="http://www.radioreloaded.com/audio/9k/8777_Gum%20Sum%20Ho%20Kyun.mp3">Gum Sum Ho Kyun, Aksar</a><br />
<a href="http://66.45.233.14/Yeh_Jo_Mohabbat_Hai_Dil_Vil_Pyar_Vyar.mp3">Ye Jo Mohabbat Hai, Dil Vil Pyar Vyar (2002)</a><br />
<a href="http://www.radioreloaded.com/audio/26k/25014_Mumma.mp3">Mumma, Dasvidaniya (2008)</a><br />
<a href="http://www.radioreloaded.com/audio/26k/25061_Tujh Mein Rab Dikhta Hai.mp3">Tujh Mein Rab Dikhta Hai, Rab Ne Bana Di Jodi (2008)</a></ol>
<p>How does it work?<br />
<span id="more-214"></span></p>
<ol>
<li>Inserting the script loads swfProxy, a flash player, from Yahoo&#8217;s server (http://l.yimg.com/us.yimg.com/i/us/mus/swf/ymwp/swfproxy-2.0.31.swf).</li>
<li>The javascript detects all hyperlinks with mp3/wav as file extension. For more details about supported types refer <a href="http://yahoomediaplayer.wikia.com/wiki/How_to_link#Playable_Links" target="_blank">wiki page</a>.</li>
<li>Then a play icon/button is inserted before each supported link. This is done using <em>em.ymp-skin</em> CSS class.</li>
<li>The Javascript then builds user interface as interactive sidebar. All images in the player are loaded by extracting small parts (using CSS) from <a href="http://l.yimg.com/us.yimg.com/i/us/mus/ymwp/mediaplayer-2.0.31.png" target="_blank">single image</a>.</li>
<li>When you click play button, the media file URL is passed to swfProxy object that actually plays the file. One thing is still wondering to me is <span style="text-decoration: underline;">how do they track mouse click event</span> on these hyperlinks?</li>
</ol>
<p>Certainly, a great idea and smart implementation!</p>
<p>- ankit<br />
<script src="http://mediaplayer.yahoo.com/js" type="text/javascript"></script><br />
[<em>Edited: 15 Feb, 09: Clarification for the fifth point under 'How it works'</em></p>
<p>JavaScript best practices suggest not to use any inline event (onClick, etc) with HTML tags. For example, following is a bad practice:</p>
<blockquote><p><code>&lt;a onclick="doSomething()" href="#"&gt;Click!&lt;/a&gt;</code></p></blockquote>
<p>Instead, you should separate out JavaScript from HTML.</p>
<blockquote><p><code>&lt;a href="backuplink.html" class="doSomething"&gt;Click!&lt;/a&gt;</code></p></blockquote>
<p>In a script block associate onClick event as following:</p>
<blockquote><p><code><br />
$('a.doSomething').click( function() {<br />
// Do something here!<br />
alert('You did something, woo hoo!');<br />
}  );<br />
...</code></p></blockquote>
<p>]</p>
]]></content:encoded>
			<wfw:commentRss>http://ankitjain.info/ankit/2009/02/08/how-yahoo-media-player-poadcast-works/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
<enclosure url="http://www.radioreloaded.com/audio/9k/8777_Gum%20Sum%20Ho%20Kyun.mp3" length="4512667" type="audio/mpeg" />
<enclosure url="http://66.45.233.14/Yeh_Jo_Mohabbat_Hai_Dil_Vil_Pyar_Vyar.mp3" length="952790" type="audio/mpeg" />
<enclosure url="http://www.radioreloaded.com/audio/26k/25014_Mumma.mp3" length="10837115" type="audio/mpeg" />
<enclosure url="http://braikhna.com/music/Tere%20Naina.mp3" length="4139133" type="audio/mpeg" />
		</item>
	</channel>
</rss>

