Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8559111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:57:55+00:00 2026-06-11T15:57:55+00:00

I am a new PhoneGap programmer. navigator.notification.alert() has not working on Android using phonegap.

  • 0

I am a new PhoneGap programmer. navigator.notification.alert() has not working on Android using phonegap. But it works on IPhone and WP7. I am developing this app in Windows Phone 7.

Thanks for your help

<!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>Cordova WP7</title>
    <link rel="stylesheet" href="master.css" type="text/css" media="screen" title="no title"
        charset="utf-8" />
    <!--<script type="text/javascript" charset="utf-8" src="cordova-2.0.0.js"></script>-->  
    <script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
    <script type="text/javascript">
        function doAlert() {
            var message = "This is an Alert dialog";
            var title = "Attention!";
            navigator.notification.alert(message, title);
        };       

    </script>
</head>
<body>
    <h1>
        Cordova Tests</h1>
    <div id="info">
         <a href="#" onclick="doAlert()">Click Me</a>  
    </div>
</body>
</html>

Finally, i got the solution.

Solution:

Before we build the phonegap code(in build.phonegap.com) we need to delete cordova-2.0.0.js file. If we delete this cordova-2.0.0.js, phonegap code is working on andriod.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T15:57:56+00:00Added an answer on June 11, 2026 at 3:57 pm

    You have to wait for DeviceReady:

    <!DOCTYPE html>
    <html>
    <head>
    <title></title>
    <meta name="viewport" content="width=device-width, initial-scale = 1.0, maximum-scale=1.0, user-scalable=no" />
    <script type="text/javascript" charset="utf-8" src="windows/cordova-2.0.0.js"></script>
    <script type="text/javascript" charset="utf-8">
        var deviceReady = false;
        function init() {
            document.addEventListener("deviceready", function () {
                deviceReady = true;
            }, false);
    
            window.setTimeout(function () {
                if (!deviceReady) {
                    alert("Error: Phonegap did not initialize.  Demo will not run correctly.");
                    console.log("Error: Phonegap did not initialize.  Demo will not run correctly.");
                }
            }, 1000);
        }
    
        function doAlert() {
            var message = "This is an Alert dialog";
            var title = "Attention!";
            navigator.notification.alert(message, title);
        }
    </script>
    </head>
    <body onLoad="init();">
    <h1>Cordova Tests</h1>
    <div id="info">
        <button onclick="doAlert();">Click Me</button>
    </div>
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to phonegap.I am using jquery mobile with html5 for developing android
I am new to android phonegap. i am storing and retrieving data using native
I am new to phonegap. How can we load an image on html5 using
I am new to phonegap and android, I have create a hello world application
I am new to PhoneGap. I am using it to deploy my website on
I am new to phonegap. I am using phonegap with IOS. the problem i
currently i using this code in phonegap application var xmlhttp = new XMLHttpRequest(); xmlhttp.open(GET,http://192.168.1.19:8080/searchMobile?categoryRequest=true,
My issue is regarding PhoneGap and Android development using the Eclipse Applaud plugin. I
I am using phonegap to develop my android application.I want to show google chart
I'm new to phoneGap, and i'm trying to implement a webview in android with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.