Downloadable files using jQuery mobile

百般思念 提交于 2019-12-12 09:41:04

问题


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?


回答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.



来源:https://stackoverflow.com/questions/13794248/downloadable-files-using-jquery-mobile

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!