<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: hoverSmack Context Menu</title>
	<atom:link href="http://www.valenceband.com/wp/rsp/36/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.valenceband.com/wp/rsp/36/</link>
	<description>by Valence Band Productions</description>
	<lastBuildDate>Sun, 13 Apr 2008 20:14:04 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
	<item>
		<title>By: Mick</title>
		<link>http://www.valenceband.com/wp/rsp/36/#comment-15</link>
		<dc:creator>Mick</dc:creator>
		<pubDate>Fri, 17 Feb 2006 13:45:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.valenceband.com/wp/rsp/36/#comment-15</guid>
		<description>Stupid Firefox.  Just so you know, when coding for Firefox and you want to get the selected text on the page...

var txt = window.getSelection();
alert(txt.length); // returns undefined because txt isn&#039;t a string.  

What is it?  A ham?  Why, it&#039;s the getSelection object!

So, instead, must do this:
var txt = new String(window.getSelection()); 
alert(txt.length); // returns the length of the selected text

I&#039;ve seen some cases where people have coded this:
var txt = window.getSelection()+&#039;&#039;; //concatenate an empty string

I think the &quot;new String()&quot; is a more elegant solution and you&#039;ll at least know what you have.

This should fix the hoverSmack context menu for Firefox and possibly Safari.  It apparently doesn&#039;t work in IE7 beta 2.</description>
		<content:encoded><![CDATA[<p>Stupid Firefox.  Just so you know, when coding for Firefox and you want to get the selected text on the page&#8230;</p>
<p>var txt = window.getSelection();<br />
alert(txt.length); // returns undefined because txt isn&#8217;t a string.  </p>
<p>What is it?  A ham?  Why, it&#8217;s the getSelection object!</p>
<p>So, instead, must do this:<br />
var txt = new String(window.getSelection());<br />
alert(txt.length); // returns the length of the selected text</p>
<p>I&#8217;ve seen some cases where people have coded this:<br />
var txt = window.getSelection()+&#8221;; //concatenate an empty string</p>
<p>I think the &#8220;new String()&#8221; is a more elegant solution and you&#8217;ll at least know what you have.</p>
<p>This should fix the hoverSmack context menu for Firefox and possibly Safari.  It apparently doesn&#8217;t work in IE7 beta 2.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

