confirm Method

This method will display a modal alert box with confirmation options.



This method will display a modal alert box that allows the user to confirm or ignore the message. The message text, function to execute on confirmation event being thrown, title, and the text for the confirm and dismiss buttons are all defined by the parameters passed to this method.



  • message: The confirmation message to show in the alert box.
  • confirmEventID: Event ID of the confirmation. Used to identify which confirm message to process when event a confirm event is thrown.
  • title: The title to put across the top of the alert box.
  • confirmbuttontext: The text to put on the button that confirms the action shown in the alert box.
  • dismissbuttontext: The text to put on the button that dismisses the action shown in the alert box.


  • intel.xdk.notification.confirm: Upon completion, this method will fire the intel.xdk.notification.confirm event that includes a "success", "answer", and "id" properties. If success, "answer" will be set to "true" for confirmation, and "id" contains the value of the confirmEventID parameter provided in the function call.


//  Set up confirmation event listener
document.addEventListener('intel.xdk.notification.confirm', receiveConfirm, false);

//  Display the confimation alert message
intel.xdk.notification.confirm("Launch native maps?", 'launchMaps', "Show A Map", "Yes", "No");

//Process the event for the confirmed message
function receiveConfirm(e)
                if( == 'launchMaps' )
                        if( e.success == true && e.answer == true ) 
                                var url = ",+Harrisburg,+PA+17602&daddr=1600+Pennsylvania+Ave+Washington,+DC+20006";
For more complete information about compiler optimizations, see our Optimization Notice.