English 中文(简体)
每一次在黑莓改用装置
原标题:deviceReady Called everytime i do a changePage() in Blackberry

我收到了Si &的申请书,使用电话:1.6.0 &JQM 1.1.0。

现在,我已经对黑莓采用了相同的法典。 我在一张超文本中拥有许多页。 我只是不断改动网页。 但是,我面临的问题是,每当安装一台更换装置时,就发射装置。 发生在Siper和Andrec。 为什么会发生?

下面是我的法典

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" id="viewport" content="width=device-width,height=device- height,initial-scale=1.0,user-scalable=no">
<script src="cordova-1.6.0.js" type="text/javascript"></script> 
<script type="text/javascript" src="jquery/jquery-1.7.1.min.js"></script>
<link rel="stylesheet" href="jquerymobile/jquery.mobile-1.1.0.min.css" />
<script type="text/javascript" src="jquerymobile/jquery.mobile-1.1.0.min.js"></script>
<script type="text/javascript">

    //---------------------------------------------------------------------
    // Cordova event listeners
    //---------------------------------------------------------------------

   function onDeviceReady() {
    alert("Inside Device Ready");
    }

    // register Cordova event listeners when DOM content loaded
    function init() {
        console.log( init() );
        document.addEventListener("deviceready", onDeviceReady, true); 
    }

</script>
<title>Cordova API Sample</title>
</head>
<body onload="init()">

   <div data-role="page" id="home">
<div data-role="header">
<h1>Here is the index page.</h1>
</div>

<div data-role="content">
<p><center>Below you may transition to our other pages.</center></p>

<a href="#about" data-ajax="false" data-role="button" data-inline="true">About  Me</a>
</div>
</div>

<div data-role="page" id="about">
<div data-role="header">
<h1>About Us</h1>
</div>

<div data-role="content">
<a href="#home" data-ajax="false" data-role="button" data-inline="true">Back Home</a>
</div>
</div>
</body>
</html>
最佳回答

我的9800个模拟器中有一例。 我重新赞扬了它,并投入了工作。

问题回答

In this you have to create one more js file for the on device ready. To call your function in to this file for new js file code i below.

//---------------------------------------------------------------------
// Cordova event listeners
//---------------------------------------------------------------------



function onDeviceReady() {
    alert("Inside Device Ready");
    }

// register Cordova event listeners when DOM content loaded
function init() {
    console.log( init() );
    document.addEventListener("deviceready", onDeviceReady, true); 
}

call this script when you require. like this





相关问题
How does AlertListener work on Blackberry API 5.0?

Does the AlertListener interface works globally on all alerts on the blackberry device, or does it only work with alerts generated by your application? In other words, can I use this interface to ...

How to buffer audio in Blackberry?

I need to learn how to buffer audio stream from a remote server in Blackberry. There is a sample buffered playback app with Blackberry api but can you tell what url may I use to test the application?

Blackberry push notification implementation

How does one implement a push notification for a blackberry app? I heard that in order to do so I need to purchase a Blackberry Enterprise Server which costs me 1400 per year. Is this true? Where is ...

热门标签