单击按钮后无法修改DIV

时间:2016-11-26 17:22:54

标签: cordova

我有一个cordova应用程序,我只想在单击按钮时修改DIV 但是当模拟器启动时,没有任何反应 我使用剪切的代码更具体 这里是代码:

var app = {

    initialize: function () {
        this.bindEvents();
    },

    bindEvents: function () {
        document.addEventListener('deviceready', this.onDeviceReady, false);
    },

    onDeviceReady: function () {

    
            var info = $('#info'),
                icon = $('#icon'),
                result;

                info.html('could not load weather');
                return;
            }
};

app.initialize();
<!DOCTYPE html>
<html>
  <head>
    <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
    <link rel="stylesheet" type="text/css" href="css/index.css">
    <title>Weather</title>
  </head>
  <body>
    <div class="app">
      <img src="" id="icon">
      <div id="info">Loading...</div>
    </div>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
    <script type="text/javascript" src="cordova.js"></script>
    <script type="text/javascript" src="js/index.js"></script>
  </body>
</html>

0 个答案:

没有答案