Creating variable from the url string and using the last one to set an image path
<p>I've got a site where I'd like to have a specific header image displayed for each individual page. The way the layout is done, it's not easily achievable with the current templating system. What I'd like to do is grab the last piece of the url string, create a variable and use that variable to complete an image path. That way I can upload images with the same name and get my desired affect.</p>

<p>I can create the array:</p>

<pre><code>var pathArray = window.location.pathname.split( '/' );
</code></pre>

<p>Not sure how to grab the last item. The number of items in the array will vary.
Also, not sure exactly how to append the image path. What I need is something like this:</p>

<pre><code>&lt;img src="/headerImages/[variable here].jpg"/&gt;
</code></pre>

<p>All the urls on the site do not have .html or .htm so we shouldn't need to filter those out.</p>

<p>Thanks in advance for any help!</p>
