I am new to JSONP and have implemented cross-domain functions for my application and everything works fine. Now I want to change my javascript code to apply object orientation.
My api
http:
CrossDomain.prototype.displayComments = function(data) {
}
Now I get an error in firebug below
ReferenceError: displayComments is not defined
I changed api to
http://localhost:8080/myApplication/getComments?callback=this.displayComments
and found that the function was added to the line for a callback like this
http:
{
}
this time another bug in firebug
SyntaxError: function statement requires a name
I have doubts whether to use JSONP in object oriented javascript or not. Please, help.
Thanks in advance.
source
share