我正在尝试使用平板电脑从我的 webapp 下载 apk 文件。
<a href="#" data-role="button" id="loginButton" class="pulsantino">Login</a>
$("#pulsanteLogin").live("click",function(){
alert("1");
window.location.href = 'http://xx.yy.zz.www:1234/staticResources/Myapp_version.apk';
alert("2");
}
我确定 url 是正确的(从浏览器启动它会正确开始文件下载),但是当我点击按钮时,我没有收到错误,也没有文件下载。我收到了“1”和“2”的警报。
我也试过
location.href = 'url';
和
window.location = 'url';
想法?