1JavaScript "classes", just like any other object, can be dynamically created. So, yes, this can be done.
2
3You would do something like this in the code handling the AJAX response (assuming that the AJAX response was providing the name of the new "class", and it's in a variable called newClassName):
4
5window[newClassName] = function() {
6 // New class name constructor code
7}
8
9window[newClassName].prototype = {
10
11 someProperty: "someValue",
12
13 someMethod: function(a, b) {
14 },
15
16 someOtherMethod: function(x) {
17 }
18}