<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel> 

      <title>Comments on: How can I use JavaScript to get an anchor from the URL?</title>
      <link>http://ask.metafilter.com/29186/How-can-I-use-JavaScript-to-get-an-anchor-from-the-URL/</link>
      <description>Comments on Ask MetaFilter post How can I use JavaScript to get an anchor from the URL?</description>
	  	  <pubDate>Fri, 16 Dec 2005 13:38:26 -0800</pubDate>
      <lastBuildDate>Fri, 16 Dec 2005 13:38:26 -0800</lastBuildDate>
      <language>en-us</language>
	  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
	  <ttl>60</ttl>

<item>
  	<title>Question: How can I use JavaScript to get an anchor from the URL?</title>
  	<link>http://ask.metafilter.com/29186/How-can-I-use-JavaScript-to-get-an-anchor-from-the-URL</link>	
  	<description>How can I use JavaScript to get an anchor from the URL? &lt;br /&gt;&lt;br /&gt; I think this is called the &lt;a href=http://docs.sun.com/source/816-6408-10/location.htm#1193379&quot; &quot;&gt;hash&lt;/a&gt; in JavaScript, but this doesn&apos;t work:&lt;br&gt;
&lt;code&gt;&lt;br&gt;
var hash=location.hash;&lt;br&gt;
if (hash){&lt;br&gt;
write a hidden form field with the value of hash&lt;br&gt;
}&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
For example, if I followed a link to &lt;a href=&quot;http://ask.metafilter.com/mefi/29185#459821&quot;&gt;this comment&lt;/a&gt;, I&apos;d want to get the value of the comment&apos;s anchor, 459821, and write it into a form field.</description>
  	<guid isPermaLink="false">post:ask.metafilter.com,2008:site.29186</guid>
  	<pubDate>Fri, 16 Dec 2005 13:30:09 -0800</pubDate>
  	<dc:creator>kirkaracha</dc:creator>
	
	<category>javascript</category>
	
	<category>hash</category>
	
	<category>notthatkindofhash</category>
	
	<category>anchor</category>
	
	<category>url</category>
	
</item>
<item>
  	<title>By: ijoshua</title>
  	<link>http://ask.metafilter.com/29186/How-can-I-use-JavaScript-to-get-an-anchor-from-the-URL#459859</link>	
  	<description>The Firefox DOM Inspector reports that the &lt;code&gt;location&lt;/code&gt; object does have a &lt;code&gt;hash&lt;/code&gt; attribute.  With which browser are you testing?</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.29186-459859</guid>
  	<pubDate>Fri, 16 Dec 2005 13:38:26 -0800</pubDate>
  	<dc:creator>ijoshua</dc:creator>
</item>
<item>
  	<title>By: ijoshua</title>
  	<link>http://ask.metafilter.com/29186/How-can-I-use-JavaScript-to-get-an-anchor-from-the-URL#459866</link>	
  	<description>It also seems to work for me in Safari.  For example, if I navigate to the comment linked above, then type &lt;code&gt;javascript:alert(location.hash)&lt;/code&gt; into the address bar and hit enter, I get alerted with the proper value.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.29186-459866</guid>
  	<pubDate>Fri, 16 Dec 2005 13:41:33 -0800</pubDate>
  	<dc:creator>ijoshua</dc:creator>
</item>
<item>
  	<title>By: reynaert</title>
  	<link>http://ask.metafilter.com/29186/How-can-I-use-JavaScript-to-get-an-anchor-from-the-URL#459885</link>	
  	<description>Works for me too (&lt;a href=&quot;http://caladan.rave.org/~pdewacht/test.html#blah&quot;&gt;my test page&lt;/a&gt;). Perhaps you could put a complete test page online somewhere?</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.29186-459885</guid>
  	<pubDate>Fri, 16 Dec 2005 13:54:21 -0800</pubDate>
  	<dc:creator>reynaert</dc:creator>
</item>
<item>
  	<title>By: kirkaracha</title>
  	<link>http://ask.metafilter.com/29186/How-can-I-use-JavaScript-to-get-an-anchor-from-the-URL#459914</link>	
  	<description>reynaert&apos;s code worked on my test page, and it&apos;s similar to what I was doing, so I might&apos;ve had a syntax error.&lt;br&gt;
&lt;br&gt;
After thinking it over some more and having some coffee, I realized that I actually want to do something different and don&apos;t need to do this, but I appreciate the help.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.29186-459914</guid>
  	<pubDate>Fri, 16 Dec 2005 14:20:00 -0800</pubDate>
  	<dc:creator>kirkaracha</dc:creator>
</item>

    </channel>
</rss>
