使用phonegap / jquery在Android设备中设置一个按钮作为默认后退按钮

时间:2012-11-23 04:27:31

标签: android cordova button back

我正在尝试使用此脚本在我的应用程序(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设备上运行...

0 个答案:

没有答案
相关问题