I tried using an init like you said but it does not seem to work. Here is the full source of the page being navigated to via "app.navigate"
<!DOCTYPE html>
<
html
>
<
head
>
<
title
></
title
>
<
meta
name
=
"viewport"
content
=
"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;"
/>
<
meta
charset
=
"utf-8"
>
<
link
rel
=
"stylesheet"
href
=
"styles/kendo.mobile.all.min.css"
type
=
"text/css"
/>
<
script
type
=
"text/javascript"
charset
=
"utf-8"
src
=
"cordova-1.7.0rc1.js"
></
script
>
<
script
type
=
"text/javascript"
charset
=
"utf-8"
src
=
"js/jquery.min.js"
></
script
>
<
script
type
=
"text/javascript"
charset
=
"utf-8"
src
=
"js/kendo.mobile.min.js"
></
script
>
<
script
type
=
"text/javascript"
charset
=
"utf-8"
>
function onBodyLoad()
{
document.addEventListener("deviceready", onDeviceReady, false);
}
/* When this function is called, Cordova has been initialized and is ready to roll */
/* If you are supporting your own protocol, the var invokeString will contain any arguments to the app launch.
for more details -jm */
function onDeviceReady()
{
// do your thing!
}
var prepareThings = function() {
console.log('preparing things');
$("#home").click(function(e){
console.log('home clicked');
e.preventDefault();
app.navigate("index.html");
});
$("#about").click(function(e){
console.log('about clicked');
e.preventDefault();
app.navigate("about.html");
});
}
</
script
>
</
head
>
<
body
onload
=
"onBodyLoad()"
>
<
div
data-role
=
"view"
data-layout
=
"app"
data-title
=
"test"
id
=
"test"
data-init
=
"prepareThings"
>
This is a test page.<
br
/>
<
a
href
=
"#"
id
=
"home"
>Home</
a
>
<
br
/>
<
a
href
=
"#"
id
=
"about"
>About</
a
>
</
div
>
</
body
>
</
html
>
None of the "console.log" instances are hit. Which means that "prepareThings" is not hit. The page loads and looks fine. If I add a script tag that just does an alert, it works, but prepareThings isn't called at all.