Take the 2-minute tour ×

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?

share|improve this question
Welcome to StackOverflow! Can you provide the code you're working with and what exactly isn't working with that code? –  Andrew Whitaker Dec 11 '12 at 0:06

1 Answer 1

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.

share|improve this answer
It worked thanks! Do you know if there is a better method than to zip files for download on mobile devices? –  user1890525 Dec 10 '12 at 21:02
fwi on android the browser downloads the zip file to the downloads folder. You can find enough unzip apps for android. (I only own android mobile devices) You have to ask yourself why does the user needs this zip on his phone/tablet? I don't know if the zip contains documents, images, videos or even music, but it might be more useful to be able to show/stream the content directly to the users maybe even directly in the browser. –  VDP Oct 28 '13 at 20:15
@user1890525 care to mark this as correct? –  andleer Jun 26 at 15:26

Your Answer


