如何在的onclick PhoneGap的/ Android的修复尤其是在较低的Andr​​oid版本? [英] How to fix onclick in Phonegap/Android especially in lower versions of Android?

查看:136
本文介绍了如何在的onclick PhoneGap的/ Android的修复尤其是在较低的Andr​​oid版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的onclick功能,工作在Android设备版本4,但不是在较低的版本。

My onclick functionality works in Android devices versions 4, but not in lower versions.

我面临着类似的问题与CSS 的位置是:固定未在较低版本的Andr​​oid设备上运行。我拿起另一种是iscroll,但我还没有修复它。

I am facing a similar problem with the CSS position:fixed that did not work in Android devices with lower versions. The alternative I took up was iscroll, but I have yet to fix it up.

我使用的科尔多瓦2.1.0和Android 2.2的PhoneGap / Android平台。

I am working in Phonegap/Android using Cordova 2.1.0 and Android 2.2.

我的SQLITE插件与科尔多瓦2.1.0兼容。

My SQLITE plugin is compatible with Cordova 2.1.0.

HTML

<div id="wrapper">
  <div id="scroller">
    <ul>
      <div id="header " class="header ">
        <div id="header_title" class="header_title"> </div>
        <div id="abc" class="abc"><img src="img/home.png" onClick="javascript:abc();"/></div>
      </div>
    </ul>

和调用JavaScript的网页的另一种方式是:

And another way of calling a page in Javascript is the following:

if(value_in_db==0) {
  document.getElementById("xyz").innerHTML = '<img src="img/inactive.png" />'
} else {
  document.getElementById("xyz").innerHTML = '<img src="img/active.png" onclick="xyz()"/> '
}

在功能

function xyz(){
   window.location.href="index.html";
}

图像完美定位。但是,当我点击,它不叫,非常塞尔顿调用。

Images are positioned perfectly. But when I click, it does not call and very seldon it calls.

注意:

所有的功能在更高的版本,除了具有更低Android版本的设备上工作说的版本2.2.1。

All the functionalities work in the higher versions except the devices with lower versions of Android say version 2.2.1.

请你指导我!我怎样才能解决这个问题?

Please do guide me! How can i fix this?

推荐答案

你能尝试用的的addEventListener功能

这篇关于如何在的onclick PhoneGap的/ Android的修复尤其是在较低的Andr​​oid版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆