I have web application which use the jsonp which return javascript codes to the client.
This is the code I return (to make it unreadable):
com.xx.load('xx','var name="hguser";function data(x){console.info(x); }')
in the load function,we eval the codes.
However,we found that it is unreadable,but it is un-debuggeable.
So I wonder if we can use this:
com.xx.load('xx',function(){
var name='hguser';
function data(x){
console.info(x);
}
});
Then,in the load function insead of eval the code string,we will now eval a function object.
Is this possible?
Does they mean the same thing?