-1

I have an autocomplete function which executes a function customOutput() inside it

  $(".search").autocomplete({
         source: function (request, response) {
                    customOutput(request);
                    }
    });

customOutput(request) returns an array How can I store the return value of customOutput(request) and use it in other function

sAaCh
  • 105
  • 1
  • 3
  • 11

2 Answers2

0

Forgive me if I'm misunderstanding your question, but if you want to save the RESPONSE that you are using for the customOutput function to be used in another function, you could declare an unassigned variable outside of the customOutput function and within the customOutput function to set it equal to RESPONSE. Then you should be able to use the response in another function.

georgehatzi
  • 133
  • 1
  • 9
0

i use this and its work

var myObject = new Object();
$(".search").autocomplete({
     source: function (request, response) {
          myObject.myData = customOutput(request);
      }
});