The My Opera forums have been replaced with forums.opera.com. Please head over there to discuss Opera's products and features
See the new ForumsYou need to be logged in to post in the forums. If you do not have an account, please sign up first.
TypeError: cannot convert to object
Hi everyone, i'm developing an extension to get rid of ads for hotmail mail service, the extension actually works but it is not passing the moderation because of this error:Uncaught exception: TypeError: Cannot convert 'elem' to object
this is the piece of code that generates the exception:
var elem = document.getElementById('MainContent');
elem.style.right = '0px'; //this line generate the exception
the weird thing is that the style is correctly modified, i do not understand what is wrong, can anyone help me?
EDIT: For now i've fixed it surrounding with a try catch statement
Originally posted by daniel:
Same solution to the same problem as yesterday. Check that the object exists.
I sent a pull request for the patch on Github.
(See! I said it would be easier to contribute once it was on Github.)
Did it, added some nice feature too! This are my very first javascript codes, but Opera's error terminal it is a very powerful debugging tool!
Originally posted by frankdd89:
Opera's error terminal it is a very powerful debugging tool!
I would recommend you spend some time with Opera Dragonfly. Break points will let you step trough your code and find out exactly what your code is up to, for example. It is an excellent tool.