我试图设置numbers
为等于digits
. 我怎样才能做到这一点?我试过'numbers' : digits
了,但它不起作用。
// Checks if the checkbox is checked or not
$('#digits').change(
function(){
if ($(this).is(':checked')) {
digits = true;
} else {
digits = false;
}
});
// When the button "apply" is pressed it sets numbers equal to digits and calls the function test
$(document).ready(function(){
$('#apply').test({
'numbers': digits // This is where I'm stuck
});
});
(function($){
var methods = {
init : function( options, callbacks) {
var settings = $.extend({
'numbers': true,
}, options);
...
...
...
etc
$.fn.test= function(method) {
alert("SUCCESS");
...
...
};
})(jQuery);