Created
March 15, 2011 21:06
-
-
Save jmertic/871485 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/* Creates an alert pop-up with the message 'Foo' */ | |
YAHOO.SUGAR.MessageBox.show({msg: 'Foo'} ); | |
/* Creates an alert pop-up with the message 'Foo' and title 'Bar' */ | |
YAHOO.SUGAR.MessageBox.show({msg: 'Foo', title: 'Bar'} ); | |
/* Creates a confirm pop-up with the message 'Foo' and title 'Bar' that does a particular action on callback based upon the button clicked */ | |
YAHOO.SUGAR.MessageBox.show({msg: 'Foo', title: 'Bar', type: 'confirm', | |
fn: function(confirm) { | |
if (confirm == 'yes') { | |
//do something if 'Yes' was clicked | |
} | |
if (confirm == 'no') { | |
//do something if 'No' was clicked | |
} | |
} | |
}); | |
/* Creates an plain pop-up ( with no 'OK' or 'Cancel' buttons ) with the message 'Foo' */ | |
YAHOO.SUGAR.MessageBox.show({msg: 'Foo', type: 'plain'} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment