doing substring in window.location.hash
<p>Somehow window.location.hash is being handled differently in different browsers. If I have a url as follows</p>

<pre><code>http://maps-demo.bytecraft.com.my/postdemo/parcel
    #parcel/history/1?as=json&amp;desc[]=ctime&amp;desc[]=history_id
</code></pre>

<p>and I am interested in getting values in between #parcel/history/ and ?as=json ... so the substring statement would be something similar to</p>

<pre><code>window.location.hash.substring(14, window.location.hash.search(/\?/g));
</code></pre>

<p>I have that work in firefox 3.0.10 without problem but the same substring statement doesn't work in Opera 9.60.</p>

<p>After some quick searching, I found some interesting info that may help</p>

<ul>
<li>window.location.hash should always return urlencoded string, but this is a <a href="https://bugzilla.mozilla.org/show%5Fbug.cgi?id=378962" rel="nofollow">bug</a> in <a href="https://developer.mozilla.org/en/DOM/window.location" rel="nofollow">Firefox</a> </li>
</ul>

<blockquote>
  <p>If the hash part of the URL contains encoded characters (see Core_JavaScript_1.5_Reference:Global_Functions:encodeURIComponent), hash returns the decoded URL part. This is a bug in Firefox. href, search and pathname return the correct, encoded URL parts.</p>
</blockquote>

<ul>
<li>Opera returns only #parcel/history/1 and ignores the remaining string, and this is the main reason why my substring statement failed...</li>
</ul>

<p>Is there a better way if I want to extract the string between #parcel/history/ and ?as=json.... besides regular expression?!</p>
