Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
A Readable jQuery Ready Event Handler
$(function () {
var $warningDialog = $("#warning"),
openDialog = function () {
$warningDialog.dialog("open");
},
closeDialog = function () {
$warningDialog.dialog("close");
},
$openButton = $("#openDialog"),
$submitButton = $("#submit"),
$nameInput = $("#names"),
inputValues = ["Foo", "Bar", "Baz"];
$warningDialog.dialog({
autoOpen: false
});
$nameInput.autocomplete({
source: inputValues
});
$openButton.click(openDialog);
$submitButton.click(closeDialog);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment