Possible Duplicate:
Download File Using jQuery
Download File Using Javascript/jQuery
$('#download').click(function() {
var url = 'http://www.mysite.com/123.txt';
location.href = url;
});
The button causes the browser to browse to the file instead of prompting a download. Is there a way to do this?