I have implemented a function u() that can transfer the result from servers to the outside so that I can do something out of the success:function(). However, I don’t know how to get the result “y” from _pass. I have tried _pass.y but got an error message.
Also, “y” was successfully assigned.
var _pass = {};
_pass = function(y) {
alert(y);
return y;
};
function u(pass) {
$.ajax({
/* ... */
success: function(html,pass) {
pass(html);
}
});}
Try this:
http://jsfiddle.net/nZnFM/8/