downloading a file using jquery stop browser following?
<p>How do i stop the browser following to the file in jquery? i want the file to just be downloaded?</p>

<pre><code>  $('#4').change(function () {
        var name = this.value;
        if (name !== "") {
            if (confirm("Are you sure you want to download " + name)) {
                $.ajax({
                    url: '/uploads/4/' + name,
                    type: 'HEAD',
                    error: function () { },
                    success: function () {
                        window.location.href = '/uploads/4/' + name;
                    }
                });
            }
        }
    });
</code></pre>

<p>This is how the code is now and it works but the file is displayed in the browser now downloaded?</p>

<p>Ive seen .preventDefault() but im not if this is what i need? or ow i should implement it if it is? </p>
