View Full Version : Embed object .setDevice function not working in Chrome

Sep 26th, 2011, 08:02 AM

I am attempting to implement a javascript joystick plugin. The project has a google code page located at: http://code.google.com/p/javascript-joystick/

After installing the plugin, the javascript works flawlessly in IE and FF, however chrome has some issues with executing it. A hosted version of what I am having trouble with can be found at http://www.jimmyblaze.net/joytest/simple.html

The issue seems to be with a snippet of code from the main script that attempts to create an object and embed it on the page. The trouble area can be found here:
try {
ctrlFF.type = "application/x-vnd.numfum-joystick";
ctrlFF.width = 0;
ctrlFF.height = 0;
* Before accessing the plug-in's script interface it needs to be
* added to the page. If the 'setDevice' call fails, the plug-in
* is assumed to either not be installed or not working in this
* browser, in which case it is removed in the catch.
document.body.appendChild(ctrlFF, document.body);
if (ctrlFF.setDevice(0) != null) {
* As with the code for IE, any non-null value is a
* success.
return ctrlFF;

Chrome doesn't seem to support the .setDevice function, as when running the chrome developer tools inspect element tool, I can see it throw an exception at that line, and prompts the user to update java, because it thinks it is out of date.

Has anyone run into this issue with chrome and know of a possible fix?

Thanks a lot for your time,


Oct 11th, 2011, 03:39 PM
Hi! Try the latest version of the plug-in from Google Code (I'm the author and I'm trying to work out why Chrome has problems).