I'm afraid that today I can lose my marble, because I do not know how to do what I want. I want to create a special invitation that I can call from any of my other JavaScript functions. I donβt know how to get this job, although it seems to me that I did it a hundred times.
Here is an example
var modal = function() {
var prompt = function(msg) {
return true;
};
}();
var items = function() {
var init = function() {
$('.delete').click(function() {
var confirm = modal.prompt('Are you sure you wanna delete that pal?');
});
};
$(document).ready(init);
}();
What I want to do is call the prompt modal method and get the return value based on user input. Now I can do it, but I'm having problems calling the internal method. I want to group them together because I will probably also have my own modal alert().
Please do not offer built-in JavaScript OK / Cancel, as I have to follow this custom.
Many thanks!