URL Parsing with JavaScript or jQuery
<p>I need to have a URL Parser written in JavaScript, that will work as described below:</p>

<p>Assuming you have this URL <code>http://www.somedomain.com/a/b/c</code></p>

<p>Then the function <code>parseURL(n)</code> will work as follows:</p>

<pre><code>var paramA = parseURL(1) // Sets paramA to "a"
var paramB = parseURL(2) // Sets paramB to "b"
var paramC = parseURL(3) // Sets paramC to "c"
var paramD = parseURL(4) // Sets paramD to null (because the path does not ripple down to d)
</code></pre>

<p>also note that if I pass this URL <code>http://www.somedomain.com/a/b/c/</code> (note that I added a backslash at the end of the URL) then the function will still work the same way.</p>

<p>This function should work on any URL of any length, so it should work on a longer URL as this one: <code>http://www.somedomain.com/a/b/c/d/e/</code>. For this URL. we can go up to <code>parseURL(5)</code> which should return "e", but <code>parseURL(6)</code> or <code>parseURL(7)</code> will both return null.</p>

<p>Thanks.</p>
