在Android中,jQuery Mobile的警告信息不显示 [英] in android, jquery mobile alert message not displaying

查看:108
本文介绍了在Android中,jQuery Mobile的警告信息不显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我执行下面的Andr​​oid手机片段,我能够看到我的网页形式,但jQuery的片段无法正常工作。

i am executing below snippet in android mobile, i am able to see my web form, but jquery snippet not working.

public class MainActivity extends DroidGap {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        super.loadUrl("file:///android_asset/www/index.html");
    }

}

jQuery的段

Jquery Snippet

   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css" />
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/mobile/latest/jquery.mobile.css" />
<link type="text/css" href="http://dev.jtsage.com/cdn/datebox/latest/jqm-datebox.min.css" rel="stylesheet" />
<!-- NOTE: Script load order is significant! -->
<script type="text/javascript" src="http://dev.jtsage.com/cdn/datebox/latest/jqm-datebox.core.min.js"></script>
<script type="text/javascript" src="http://dev.jtsage.com/cdn/datebox/latest/jqm-datebox.mode.flipbox.min.js"></script>
<script type="text/javascript">
$(document).ready(function () // Call function when page is ready for load..
{
    alert("Step 1");
});
</script>
</head>
<body>
<div data-role="page">
  <div data-role="header"data-position="fixed" >
    <h1>My Income</h1>
  </div>
  <div data-role="content">
    <form id="myincome" data-ajax="true">
      <table data-role="table" data-mode="columntoggle">
        <tr>
          <th>CUSTOMER NAME</th>
          <th><input type="text" name="txt_cust_name" id ="txt_cust_name"/></th>
        </tr>
        <tr>
          <th colspan="2"><input type="button" value="Save Changes" id="save_me" /></th>
        </tr>
      </table>
    </form>
  </div>
  <div data-role="footer" data-position="fixed">
    <p>Footer</p>
  </div>
</div>
</body>
</html>

不显示Java脚本警报。

java script alert not displayed.

推荐答案

使用

    document.addEventListener("deviceready", onDeviceReady, false);
    function onDeviceReady() 
   {
    alert("Step 1");
    }

和阅读理解页是如何在这里jQuery Mobile的加载是一个例子。

and read understand how pages are loaded in jquery mobile here is an example

http://jquerymobile.com/demos/1.2。 0 /文档/页/页template.html

右键查看code或在这里得到理论

right to view code or get the theory here

http://api.jquerymobile.com/loader/

所有的最好的。

这篇关于在Android中,jQuery Mobile的警告信息不显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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