Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Downloadable files using jQuery mobile

I'm fairly new to jquery mobile, and am getting an error when trying to link a file in my jquery mobile project for download. I would like a user to be able to download a .zip file from the app, but get either a page loading error, or undefined displayed in a new page. I tried using an anchor tag to link the file to download, but it doesn't seem to work right. I know jquery mobile makes use of the anchor tag, so I don't know if there is something special that needs to be done. Any help?

like image 477
user1890525 Avatar asked Dec 15 '22 16:12

user1890525


1 Answers

You are likely getting the exception when jQuery Mobile assumes the link is a page and attempts an AJAX page load. Disable AJAX loading on the link.

<a href="yourfile.zip" data-ajax="false">Link</a>

And I have no idea what the typical mobile browser will do with a link to zip file.

like image 94
andleer Avatar answered Mar 02 '23 17:03

andleer