<?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>Eddie On Everything &#187; javascript</title>
	<atom:link href="http://www.eddieoneverything.com/category/javascript/feed" rel="self" type="application/rss+xml" />
	<link>http://www.eddieoneverything.com</link>
	<description>Tips &#38; tricks on things that interest me</description>
	<lastBuildDate>Wed, 11 Jan 2012 08:29:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Evil Reddit Javascript Code</title>
		<link>http://www.eddieoneverything.com/javascript/evil-reddit-javascript-code.php</link>
		<comments>http://www.eddieoneverything.com/javascript/evil-reddit-javascript-code.php#comments</comments>
		<pubDate>Thu, 31 Dec 2009 18:57:51 +0000</pubDate>
		<dc:creator>eddie</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[downvote]]></category>
		<category><![CDATA[reddit]]></category>
		<category><![CDATA[upvote]]></category>

		<guid isPermaLink="false">http://www.eddieoneverything.com/?p=503</guid>
		<description><![CDATA[Reddit.com is a user community where people share new ideas and insightful commentary.  Nah, just kidding &#8211; it&#8217;s just a website where you can find links to certain mob-approved topics. If you&#8217;re so inclined,you can even argue with and insult other people over those links. Ain&#8217;t the internet grand?
One silly feature of Reddit is [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.reddit.com">Reddit.com</a> is a user community where people share new ideas and insightful commentary.  Nah, just kidding &#8211; it&#8217;s just a website where you can find links to certain mob-approved topics. If you&#8217;re so inclined,you can even argue with and insult other people over those links. Ain&#8217;t the internet grand?</p>
<p>One silly feature of Reddit is the &#8220;karma&#8221; feature, where uses can vote a topic or comment &#8220;up&#8221; or &#8220;down&#8221; based on their opinion of the topic, the commenter, the commenter&#8217;s mom, or even the commenter&#8217;s command of the English language. At first, this might sound like a good idea.  After all, if something is useful or insightful, it will then garner a lot of votes, right? </p>
<p>Wrong. In practice, what really happens is that anyone who disagrees with your viewpoint will vote your comment &#8220;down&#8221; for any reason at all, thus ensuring that differing viewpoints are never heard or considered. For instance, say you posted that you kind-of liked Microsoft&#8217;s new search engine &#8220;Bing,&#8221; and stated that its map feature had a couple of innovative ideas.  Well you&#8217;d be instantly voted down by people who hate Microsoft, by geeks that love Google, by denizens that worship Apple, by GPS-fanatics, and people who just don&#8217;t care. You&#8217;ll garner just a few measly &#8220;upvotes&#8221; from people who might have had a chance to read your comments before they were down-voted to internet oblivion.  Ain&#8217;t the internet grand?</p>
<p>And that&#8217;s if you&#8217;re lucky.  If you&#8217;re unlucky, the disagreeing party will go through all of your past comments and vote them all &#8220;down,&#8221; thus ruining your &#8220;karma&#8221; score and decreasing your standing on the site. </p>
<p>In the end, it&#8217;s a pretty silly system.</p>
<p>So, here&#8217;s a little code that will help send that message:</p>
<p>Downvote every comment on a page:<br />
<code>javascript:(function f(){var u=$(".down");if(u.length-1){setTimeout(f,100);u[1].onclick()} })()<br />
</code><br />
Upvote every comment on a page:<br />
<code>javascript:(function f(){var u=$(".up");if(u.length-1){setTimeout(f,100);u[1].onclick()} })()<br />
</code></p>
<p>Just paste the above code into your browser&#8217;s location bar and it will either upvote or downvote every comment on a page.</p>
<p>Ain&#8217;t the internet grand?</p>
<h2  class="related_post_title">Related Posts</h2><ul class="related_post"><li><a href="http://www.eddieoneverything.com/articles/how-to-set-the-window-size-and-position-of-a-chrome-application-shortcut.php" title="How to Set the Window Size and Position of a Chrome Application Shortcut">How to Set the Window Size and Position of a Chrome Application Shortcut</a></li><li><a href="http://www.eddieoneverything.com/articles/adding-a-confirm-dialog-to-instapapers-read-later-bookmarklet.php" title="Adding a Confirm Dialog To Instapaper&#8217;s &#8220;Read Later&#8221; Bookmarklet">Adding a Confirm Dialog To Instapaper&#8217;s &#8220;Read Later&#8221; Bookmarklet</a></li><li><a href="http://www.eddieoneverything.com/programming/how-to-set-a-class-name-using-javascript-in-ie-and-other-browsers.php" title="How To Set a Class Name using Javascript in IE and Other Browsers">How To Set a Class Name using Javascript in IE and Other Browsers</a></li><li><a href="http://www.eddieoneverything.com/internet/how-to-reveal-stored-passwords-in-firefox-chrome-safari-and-ie.php" title="How To Reveal Stored Passwords in Firefox, Chrome, Safari, and IE">How To Reveal Stored Passwords in Firefox, Chrome, Safari, and IE</a></li><li><a href="http://www.eddieoneverything.com/programming/calculate-the-days-since-a-given-date-javascript.php" title="Calculate the Days Since a Given Date (Javascript)">Calculate the Days Since a Given Date (Javascript)</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.eddieoneverything.com/javascript/evil-reddit-javascript-code.php/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Calculate the Days Since a Given Date (Javascript)</title>
		<link>http://www.eddieoneverything.com/programming/calculate-the-days-since-a-given-date-javascript.php</link>
		<comments>http://www.eddieoneverything.com/programming/calculate-the-days-since-a-given-date-javascript.php#comments</comments>
		<pubDate>Sat, 14 Nov 2009 23:12:28 +0000</pubDate>
		<dc:creator>eddie</dc:creator>
				<category><![CDATA[Calculators]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://www.eddieoneverything.com/?p=258</guid>
		<description><![CDATA[I recently needed to calculate the number of days that had elapsed since a given date.  Not happy with any of the code snippets I found on the internet, I wrote my own.  A demo is below, along with the the javascript code.  Note that the code uses a bit of dynamic [...]]]></description>
			<content:encoded><![CDATA[<p>I recently needed to calculate the number of days that had elapsed since a given date.  Not happy with any of the code snippets I found on the internet, I wrote my own.  A demo is below, along with the the javascript code.  Note that the code uses a bit of dynamic HTML so no page refresh is necessary.  The answer will appear beneath the form.</p>
<p>Feel free to use these in your projects.</p>
<div class="q">
<h3>Demo &#8211; Calculate the number of days since a given date</h3>
<p><script type="text/javascript" src="/js/daysSince.js"></script></p>
<form id="theForm" name="theForm" method=POST>
<br />Day<br />
<input type=text name=day id="day">
<br />Month<br />
<input type=text name=month id="month">
<br />Year<br />
<input type=text name=year id="year">
<input type=button onclick='daysSince(document.getElementById("month").value,document.getElementById("day").value,document.getElementById("year").value)' value ="Calculate days since">
<p>
<div id="result"></div>
</form>
</div>
<p>To get this to work on your website, you&#8217;ll need the following javascript function, along with the HTML file below.</p>
<p>The JavaScript:</p>
<pre name="code" class="javascript">
function daysSince(m,d,y){
   if (d == '' || m=='' || y==''){
      alert ("All fields must be entered");
      return;
   }

   if (isNaN(m) || isNaN(y) || isNaN(d)){
      alert("Only numbers .");
      return;
   }

   var myDate=new Date();
   var yourDate=new Date(y,m-1,d);

   var secondsInADay = 1000*60*60*24;
   var diff = Math.floor( (myDate.getTime() - yourDate.getTime()) / secondsInADay );
   document.getElementById("result").innerHTML= "It has been " +
      diff + " days since " + m + "/" + d + "/" + y +".";
}
</pre>
<p>The HTML:</p>
<pre name="code" class="HTML">
<form action ="" id="theForm" name="theForm">
Day
<input type=text name=day id="day">
Month
<input type=text name=month id="month">
Year
<input type=text name=year id="year">
<input type=button onclick='daysSince(document.getElementById("month").value,document.getElementById("day").value,document.getElementById("year").value)' value ="Calculate days since">
<div id="result"></div>
</form>
</pre>
<p>If you make any useful alterations, feel free to share them in the comments.</p>
<h2  class="related_post_title">Related Posts</h2><ul class="related_post"><li><a href="http://www.eddieoneverything.com/articles/how-to-scan-a-computer-for-open-ports.php" title="How to Scan a Computer for Open Ports">How to Scan a Computer for Open Ports</a></li><li><a href="http://www.eddieoneverything.com/articles/the-zen-of-taco-bell-programming-using-unix-tools-to-prevent-reinventing-the-wheel.php" title="The Zen of Taco Bell Programming &#8211; Using Unix Tools to Prevent Reinventing the Wheel">The Zen of Taco Bell Programming &#8211; Using Unix Tools to Prevent Reinventing the Wheel</a></li><li><a href="http://www.eddieoneverything.com/programming/how-to-use-global-variables-from-another-file-in-a-perl-module-or-package.php" title="How To Use Global Variables From Another File In A Perl Module or Package">How To Use Global Variables From Another File In A Perl Module or Package</a></li><li><a href="http://www.eddieoneverything.com/programming/getting-phps-print_r-function-to-return-a-string.php" title="Getting PHP&#8217;s print_r Function To Return A String">Getting PHP&#8217;s print_r Function To Return A String</a></li><li><a href="http://www.eddieoneverything.com/programming/how-to-set-a-class-name-using-javascript-in-ie-and-other-browsers.php" title="How To Set a Class Name using Javascript in IE and Other Browsers">How To Set a Class Name using Javascript in IE and Other Browsers</a></li><li><a href="http://www.eddieoneverything.com/programming/calibre-recipe-for-minneapolis-star-tribune-startribune-com.php" title="Calibre Recipe for Minneapolis Star Tribune (StarTribune.com)">Calibre Recipe for Minneapolis Star Tribune (StarTribune.com)</a></li><li><a href="http://www.eddieoneverything.com/linux/argument-list-too-long-from-rm-command-a-perl-script-to-get-around-the-problem.php" title="&#8220;Argument list too long&#8221; from rm command.   A Perl Script to Get Around the Problem">&#8220;Argument list too long&#8221; from rm command.   A Perl Script to Get Around the Problem</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.eddieoneverything.com/programming/calculate-the-days-since-a-given-date-javascript.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Make any website editable with this handy javascript snippet</title>
		<link>http://www.eddieoneverything.com/internet/make-any-website-editable-with-this-handy-javascript-snippet.php</link>
		<comments>http://www.eddieoneverything.com/internet/make-any-website-editable-with-this-handy-javascript-snippet.php#comments</comments>
		<pubDate>Wed, 24 Dec 2008 01:30:12 +0000</pubDate>
		<dc:creator>eddie</dc:creator>
				<category><![CDATA[internet]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.eddieoneverything.com/internet/make-any-website-editable-with-this-handy-javascript-snippet.php</guid>
		<description><![CDATA[I recently spotted this handy little tip at blogstorm.co.uk.  
Ever wanted to edit the text of a web page to create an annotated screenshot or mockup?  Simply paste this line of code into your browser&#8217;s location bar, and voila, the page text can be edited:
javascript:document.body.contentEditable='true'; document.designMode='on'; void 0
No, you it doesn&#8217;t enable you [...]]]></description>
			<content:encoded><![CDATA[<p><!--adsense#468banner--></p>
<p>I recently spotted this handy little tip at <a href="http://www.blogstorm.co.uk/cut-and-paste-one-line-of-code-to-make-any-website-editable/718/">blogstorm.co.uk</a>.  </p>
<p>Ever wanted to edit the text of a web page to create an annotated screenshot or mockup?  Simply paste this line of code into your browser&#8217;s location bar, and voila, the page text can be edited:</p>
<p><code>javascript:document.body.contentEditable='true'; document.designMode='on'; void 0</code></p>
<p>No, you it doesn&#8217;t enable you to edit the original page.  It does, however, let you easily alter your local copy.  </p>
<p>Handy, eh?</p>
<p><!--adsense#468banner--></p>
<h2  class="related_post_title">Random Posts</h2><ul class="related_post"><li><a href="http://www.eddieoneverything.com/nutrition/what-is-the-difference-between-net-carbs-and-carbohydrates.php" title="What is the difference between Net Carbs and Carbohydrates?">What is the difference between Net Carbs and Carbohydrates?</a></li><li><a href="http://www.eddieoneverything.com/internet/how-to-use-your-netgear-or-linksys-or-d-link-wireless-router-as-a-hub.php" title="How to use your Netgear (or Linksys, or D-Link) wireless router as a Hub">How to use your Netgear (or Linksys, or D-Link) wireless router as a Hub</a></li><li><a href="http://www.eddieoneverything.com/consumer-protection/ing-direct-easy-orange-mortgage-not-as-easy-as-you-think.php" title="ING Direct Easy Orange Mortgage &#8211; Not As Easy As You Think">ING Direct Easy Orange Mortgage &#8211; Not As Easy As You Think</a></li><li><a href="http://www.eddieoneverything.com/articles/getting-lastpass-to-remember-htaccess-basic-auth-passwords-in-chrome.php" title="Getting LastPass to Remember .htaccess (Basic Auth) Passwords in Chrome">Getting LastPass to Remember .htaccess (Basic Auth) Passwords in Chrome</a></li><li><a href="http://www.eddieoneverything.com/programming/customizing-the-calibre-associated-press-ap-recipe.php" title="Customizing the Calibre Associated Press (AP) Recipe">Customizing the Calibre Associated Press (AP) Recipe</a></li><li><a href="http://www.eddieoneverything.com/lists/what-are-the-10-strongest-retail-markets-in-the-u-s.php" title="What are the 10 strongest retail markets in the U.S.?">What are the 10 strongest retail markets in the U.S.?</a></li><li><a href="http://www.eddieoneverything.com/articles/the-difference-between-indorse-and-endorse.php" title="The Difference Between Indorse and Endorse">The Difference Between Indorse and Endorse</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.eddieoneverything.com/internet/make-any-website-editable-with-this-handy-javascript-snippet.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

