jQuery cannot get the file part from href attribute
<p>I am trying to get the href value of an anchor tag using jquery, instead of getting the absolute url, jquery returns just the url without the file part: This is what i mean:</p>

<p>My Html/php</p>

<pre><code>$url = "http://localhost/mysite/assets/data.txt";
&lt;a class='view-chart' href="&lt;?php echo $url?&gt;"&gt;View Chart&lt;/a&gt;
</code></pre>

<p>My jQuery Code:</p>

<pre><code>var url = $('a.view-chart').attr('href');
alert(url);
</code></pre>

<p>I get this on the alert:</p>

<pre><code>http://localhost/mysite/assets/
</code></pre>

<p>but when I view source on the browser, I see</p>

<pre><code>http://localhost/mysite/assets/data.txt
</code></pre>

<p>But if I do:</p>

<pre><code>&lt;a class='view-chart' href="http://localhost/mysite/assets/data.txt"&gt;View Chart&lt;/a&gt; 
</code></pre>

<p>I get the correct alert message i.e:</p>

<pre><code>http://localhost/mysite/assets/data.txt
</code></pre>
