Skip to content

Instantly share code, notes, and snippets.

@nikku
Created January 26, 2012 20:04
Show Gist options
  • Select an option

  • Save nikku/1684769 to your computer and use it in GitHub Desktop.

Select an option

Save nikku/1684769 to your computer and use it in GitHub Desktop.
<a href="#" id="show-alert">alert</a>,
<a href="#" id="show-confirm">confirm</a>,
<a href="#" id="show-prompt">prompt</a>
<script type="text/javascript">
$("#show-alert").click(function(event) {
$.fn.dialog2.helpers.alert("This dialog is non intrusive", {
close: function() {
alert("This one is!");
}
});
event.preventDefault();
});
$("#show-prompt").click(function() {
$.fn.dialog2.helpers.prompt("What is your age?", {
ok: function(event, value) { alert("Your age is: " + value); },
cancel: function() { alert("Better tell me!"); }
});
event.preventDefault();
});
$("#show-confirm").click(function() {
$.fn.dialog2.helpers.confirm("Is this dialog non intrusive?", {
confirm: function() { alert("You said yes? Well... no"); },
decline: function() { alert("You said no? Right choice!") }
});
event.preventDefault();
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment