result from Ajax Call : <p>I have an ajax call and I want to use result of this ajax on another page.</p>

<p>//This is main.js file</p>

<pre><code>function myFun(){
    var my_user = "Stas";
    var itemsUrl = "myxmlwithusers";
    var user_found = false;
    $.ajax({
         url: itemsUrl,
         method: "GET",
         headers: { "Accept": "application/json; odata=verbose" },
         cache: false,
         async: false,
         dataType: "text",
         success: function(data){
            var jsonObject = JSON.parse(data);
            results = jsonObject.d.results;
            $(results).each(function(){ 
                if($(this)[0].user == my_user){
                     user_found = true;
                }
            });
         },
         error:function () {
              console.log("Error");
          }
        }
    );
}
</code></pre>

<p>// This is execute.js file</p>

<pre><code>myFun();
if (user_found == true){cool}
</code></pre>

<p>I need true or false for // user_found. Let say I will put in the file execute.js my function myFun() and in main.js my user is fetch with "$(this)[0].user" and I need to receive "true" in execute.js</p>

<p>Thanks!</p>
