-
Notifications
You must be signed in to change notification settings - Fork 724
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"TypeError: keyboard is undefined" error #157
Comments
Hmm, I think the problem is that the In the mean time, after looking at what you're trying to do, it might be better if you didn't use the preview window. So, set the $(function(){
var $kb = $('#keyboard').keyboard({
layout : 'custom',
customLayout : {[ ... ]},
alwaysOpen : true,
useCombos : false,
change : function(){
checkWord( $kb.val() );
}
});
}); I'll fix the change callback function in the next update. |
Thanks for your help! That eliminated the javascript error, but adding the
|
Hmm, that is weird too! LOL Well, it seems that the jQuery UI position utility isn't positioning the keyboard in the right place, so I guess we could add this function to give it a little kick start. It's not ideal, but I don't have that much time right now to troubleshoot that problem. $(function(){
var $kb = $('#keyboard').keyboard({
layout : 'custom',
customLayout : {[ ... ]},
alwaysOpen : true,
useCombos : false,
change : function(){
checkWord( $kb.val() );
},
initialized : function() {
$(window).resize();
}
});
}); |
Hi Mottie,
I'm working on a hobby project using your keyboard and have run into an issue.
I have the following code when the keyboard is being created:
But sometimes Firebug shows the following error in the console:
TypeError: keyboard is undefined
And it points to the line of code inside the change callback.
I think this error is resulting the in the checkWord() function not being run, and it might also be causing another problem as well (when a number of divs are clicked, I have onclick handlers that have
$("#keyboard").focus();
in them, but the focus isn't returned to the text input when the error shows up in the console).Here is my page: http://tinyurl.com/bqddgjl
Do you have any idea why this might be happening?
The text was updated successfully, but these errors were encountered: