Created
October 7, 2015 00:01
-
-
Save doronkatz/d1c486b7cc9e0c9c9a69 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
App.onLaunch = function(options) { | |
// 1 | |
var alert = createAlert("Hello World", ""); //leaving 2nd parameter with an empty string | |
navigationDocument.presentModal(alert); | |
} | |
// 2 | |
var createAlert = function(title, description) { | |
var alertString = `<?xml version="1.0" encoding="UTF-8" ?> | |
<document> | |
<alertTemplate> | |
<title>${title}</title> | |
<description>${description}</description> | |
</alertTemplate> | |
</document>` | |
var parser = new DOMParser(); | |
var alertDoc = parser.parseFromString(alertString, "application/xml"); | |
return alertDoc | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment