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 9063169
In Process

The Archive Base Latest Questions

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

I am creating a simple phonegap based application using jQuery mobile. Here is the

  • 0

I am creating a simple phonegap based application using jQuery mobile.

Here is the Header of my HTML

<script src="scripts/jquery-1.8.2.min.js"></script>
<script src="scripts/jquery.mobile-1.1.1.min.js"></script>
<script src="scripts/jquery.jsonp-2.4.0.min.js"></script>
<script type="text/javascript" charset="utf-8" src="scripts/cordova-2.2.0.js"></script>
<script src="scripts/my.js"></script>

In the body after all my HTML code I have added

<script>
$(document).ready(function() {
navigator.notification.confirm('Do you want to quit', 
        function(){
            if(button == "1"){
                 navigator.app.exitApp(); }
        }, 
        'QUIT TITLE', 
        'OK,Cancel'  
    );
</script>

I get the error

12-27 21:28:17.998: D/CordovaLog(17212): Uncaught TypeError: Cannot
call method ‘confirm’ of undefined 12-27 21:28:17.998:
D/CordovaLog(17212): file:///android_asset/www/app.html: Line 227 :
Uncaught TypeError: Cannot call method ‘confirm’ of undefined

As you can see I have loaded all the necessary scripts, and I am calling the navigator.notification.confirm inside $(document).ready

Not sure why I am getting this error. Please help.

  • 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-16T15:55:27+00:00Added an answer on June 16, 2026 at 3:55 pm

    First your code inside script tag is not closed properly.

    You are trying to use a Phonegap library before is is successfully loaded. $(document).ready(function() { should not be used with jQuery mobile (you will find more about this in a bottom link), nor it will tell you if phonegap libraries are loaded.

    Your code should be initialized like this:

    document.addEventListener("deviceReady", deviceReady, false);
    
    function deviceReady() {
        navigator.notification.confirm('Do you want to quit', 
            function(){
                if(button == "1"){
                    navigator.app.exitApp(); 
                }
            }, 
            'QUIT TITLE', 
            'OK,Cancel'  
        );
    }
    

    You can find more about this here: https://stackoverflow.com/a/14010308/1848600 and here: http://docs.phonegap.com/en/1.0.0/phonegap_events_events.md.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating a webapp for iPhone using jQuery Mobile and PhoneGap. Everything works
I'm creating a simple game using HTML and CSS. I have a background image
I am creating simple blog web application using play framework and i want to
I'm creating a simple web based game using the HTML5 canvas and JavaScript. I
I'm creating a simple app with jquerymobile build with phonegap which is using iframe
I'm creating simple script to convert mp3 files using shell script. I decided to
I'm creating a mobile app using PhoneGap. So effectively I'm writing the app in
I am creating a simple application for the Mobile to retrieve netflix information via
I'm creating simple example on JSF. It's small Login application. My problem is duplicate
i am creating simple call filter application which restrict unwanted calls. i use following

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.