Load Users into jQuery during onLoad of a page for a Live Search
<p>All,
I've got the following code to which is basically a function that loads some search terms in it when the DOM is loading:</p>

<pre><code>window.myAutocompleteFunction = function(){
return ['Test Saying','sit amet consectetur adipiscing','elit Nulla et justo'];
};
</code></pre>

<p>This works fine for my live search and updates correctly. I'm trying to populate these values based on some information from my database though. I tried to update my code to use a .get function to populate my return values and I tried to make it look like this:</p>

<pre><code>window.myAutocompleteFunction = function(){
$.get('http://localhost/website/load_users.php', function(data) {
    alert(data);
    return [data];
});
};
</code></pre>

<p>It tries to load the users and in my alert it is the same as when it's manually typed in but for some reason when I do the search it doesn't work. Any idea how to get the same results from my file and have the search work the same?</p>

<p><strong>EDIT:</strong> The only thing in my load_users.php file right now is the following:</p>

<pre>
'Test Saying','sit amet consectetur adipiscing','elit Nulla et justo'
</pre>

<p>I'm going to try and populate that with database values but just trying to get this to work for now.</p>

<p><strong>Another Edit:</strong> I also tried to make my code like the following just to see if it work work:</p>

<pre><code>window.myAutocompleteFunction = function(){
jQuery.get('http://localhost/okyne/load_users.php', function(data) {
    alert(data);
    return ['Test Saying','sit amet consectetur adipiscing','elit Nulla et justo'];
});
};
</code></pre>

<p>This doesn't work either so I'm not sure why it wouldn't work and the only thing that works for me so far is the first code snippet that I provided.</p>

<p>Any help you can provide is greatly appreciated!</p>
