Jquery not working with phoneGap

前端 未结 3 887
花落未央
花落未央 2021-01-28 04:04

I am using phonegap, and this code loads perfectly in my android mobile.But When i click the button it does not shows the text.

    


        
3条回答
  •  逝去的感伤
    2021-01-28 04:34

    When working with mobile devices, it is greatly recommended that you use the mobile version of jquery, jquery.mobile.js

    Then you can use vclick and everything works fine:

    Normalized event for handling touchend or mouse click events on touch devices.

    $(document).ready(function(){
         $("#btn1").vclick(function(){
           $("#test1").text("Hello world!");
         });
    });
    

提交回复
热议问题