Skip to content

Instantly share code, notes, and snippets.

@netsi1964
Created July 11, 2012 22:16
Show Gist options
  • Save netsi1964/3094091 to your computer and use it in GitHub Desktop.
Save netsi1964/3094091 to your computer and use it in GitHub Desktop.
jQuery.my boilerplate
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>jQuery.my boilerplate</title>
</head>
<body>
<div id="form">
<label for="field">Enter something and it will be UPPERCASE</label>
<input type="text" id="field" />
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js"></script>
<script src="http://dl.dropbox.com/u/3260327/jQuery/jquery.my-0.4.min.js"></script>
<script src="http://dl.dropbox.com/u/3260327/jQuery/sugar-1.2.5.min.js"></script>
<script>
(function($, window, undefined) {
// Your code here, put just above /body
// $ = jQuery
$("#form").my({
data: {x: 0},
ui: {
"#field": function (data, val, $control) {
alert('did you...?')
console.log(data, val, $control);
if (val!=null) data.x = val;
return data.x;
}
}
});
})(jQuery, window);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment