0

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

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.

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

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>

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()"/> '
}

In the Function

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

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

Note:

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?

user
  • 1,001
  • 4
  • 21
  • 45

1 Answers1

-1

Could you try to handle your click with the addEventListener function?

poiuytrez
  • 21,330
  • 35
  • 113
  • 172
  • I am asking your opinion, will this work based on my this edited version of the question? I want to know your view and at the same time bit confused how to use this? – user Jun 11 '13 at 08:58