<?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>Tommy Chheng &#187; Javascript</title>
	<atom:link href="http://tommy.chheng.com/index.php/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://tommy.chheng.com</link>
	<description>All Things Programming!</description>
	<lastBuildDate>Wed, 11 Aug 2010 05:58:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>How to make a Javascript Bookmarklet</title>
		<link>http://tommy.chheng.com/index.php/2010/03/javascript-bookmarklet/</link>
		<comments>http://tommy.chheng.com/index.php/2010/03/javascript-bookmarklet/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 23:22:23 +0000</pubDate>
		<dc:creator>tommy</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://tommy.chheng.com/?p=240</guid>
		<description><![CDATA[There&#8217;s a niffy trick in browsers that you you execute Javascript code in the url location bar. (This is how a lot of security holes are created too!) Try typing the below into your browser url bar: javascript:alert('look how cool this is') Cool, it runs javascript! You may have noticed a lot of websites take [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s a niffy trick in browsers that you you execute Javascript code in the url location bar. (This is how a lot of security holes are created too!)<br />
Try typing the below into your browser url bar:<br />
<code><br />
javascript:alert('look how cool this is')<br />
</code><br />
Cool, it runs javascript!</p>
<p>You may have noticed a lot of websites take advantage of this to enhance a service. Instapaper&#8217;s &#8220;Read Later&#8221; saves the current page and Pastefire&#8217;s &#8220;Pastefire this&#8221; saves the selected text.</p>
<p>To make your own, just write javascript inside a link tag as a one liner.  Then just ask users to click and drag the link to the bookmark toolbar.<br />
<img src="http://tommy.chheng.com/wp-content/uploads/2010/03/sprocketit_bookmarklet.png" alt="" title="sprocketit_bookmarklet" width="418" height="85" class="alignnone size-full wp-image-243" /></p>
<p>Here&#8217;s an example for my Next Sprocket site which will start you on a new open source task with the title and description partially filled out:<br />
<a href="javascript:(function(){location.href='http://nextsprocket.com/tasks/new?task[title]='+encodeURIComponent(document.title)+'&amp;task[description]=More details at '+encodeURIComponent(window.location.href)})()">Sprocket it!</a></p>
<p><code><br />
&lt;a href="javascript:(function(){location.href='http://nextsprocket.com/tasks/new?task[title]='+encodeURIComponent(document.title)+'&amp;task[description]=More details at '+encodeURIComponent(window.location.href)})()"&gt;Sprocket it!&lt;/a&gt;<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://tommy.chheng.com/index.php/2010/03/javascript-bookmarklet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
