..invalid type sobject type ApexClass is not supported...
The error is verbose than that but thats the general message.
var queryResult = sforce.connection.query("SELECT namespaceprefix FROM ApexClass WHERE name='Ctl_Form' LIMIT 1");
This works fine in other orgs, any idea what setting or configuration might not allow this? I'm logged in a a System Admin.
I also tested running a SOQL query against ApexClass in the dev console and that ran fine.