Ich habe gerade ein neues Projekt mit dem Visual Studio Cordova Starter-Vorlage erstellt. Jedoch kann ich die javascript document ready-Funktion nicht aufrufen, wenn sie vom Windows Phone 7-Emulator ausgeführt wird. Wenn es von einem Browser ausgeführt wird, wird es als gut bezeichnet.Javascript document.ready() Funktion funktioniert nicht in Windows Phone Emulator mit Cordova 1.5
onDeviceReady()...
wird auf der Konsole protokolliert, aber $(document).ready(...)
nicht.
Kann jemand irgendeinen offensichtlichen Grund dafür sehen?
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
<title>Title</title>
<link rel="stylesheet" href="jquery.mobile-1.0.1.css"/>
<script src="jquery-1.7.1.js"></script>
<script src="jquery.mobile-1.0.1.js"></script>
<script type="text/javascript" charset="utf-8" src="cordova-1.5.0.js"></script>
</head>
<body>
<div id="home" data-role="page">
</div>
<script type="text/javascript">
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log("onDeviceReady. You should see this message in Visual Studio's output window.");
}
$(document).ready(function() {
console.log("doc ready");
});
</script>
</body>
</html>