Reputation: 467
I'm developing a wp7 application using phone gap version 2.9.0 Before I just working in version 2.0.0 alert are working but now i using 2.9.0 the same alert not working now . below i add my code used.
<input type="button" value="click" onclick="return confirm('are you sure')"; />
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="js/jQuery v1.10.2 .js"></script>
<script type="text/javascript" >
$(document).ready(function() {
alert("hi");
});
</script>
both the onclick return and alert not show in emulator but the same code work fine in all browser including IE9,8,7. can anyone plz provide me a detailed solution for my problem. following things i all ready try.
Try1
document.addEventListener("deviceready",onDeviceReady,false);
function onDeviceReady()
{
// IE does NOT provide an alert method, you can patch it with this line after deviceready.
window.alert = window.alert || navigator.notification.alert;
alert("Hello World WP7");
}
Try2 [add this code in config.xml file]
<feature name="Notification">
<param name="wp-package" value="Notification"/>
</feature>
Nothing Help Any other method Available or I just change any thing in above code.
Upvotes: 2
Views: 1503
Reputation: 467
I Solve My Problem
FirstAdd the following Code in Config file
<feature name="Notification">
<param name="wp-package" value="Notification"/>
</feature>
Then In Html File Or Any Other File Just Add The Following Code For Alert
navigator.notification.alert("xxxxxx");
Now Its Worked
Upvotes: 4