我正在尝试使用此脚本在我的应用程序(html+css+js+jquery)上设置一个按钮,该按钮与 android 设备的默认按钮相同。
这是脚本:
</script>
<script type="text/javascript">
$(document).ready(function(){
$('a.back').click(function(){
if(document.referrer.indexOf(window.location.hostname) != -1){
parent.history.back();
return false;
}
});
});
</script>
然后我在使用脚本的代码中有类似的东西:
<a class="back">
<img src="back.png" id="back" style="width: 75%;"></a></div>
这在互联网浏览器中运行良好,但在使用 PhoneGap 编译时不适用于 android 设备......