jQuery JSON database variable applied in Javascript
===

This could be an easy task but I am just learning the relationship between jQuery, JSON, and Javascript. I used jQuery to to pull from my database and create a variable called res[i].showlink which is a url. Here is part of my code for the call.

       $.get("http://databasecall=json",        {}, function(res) {
                                       $.mobile.hidePageLoadingMsg();
                                       if(res.length){
                                       var s = "";
                                       for(var i=0; i<res.length; i++) {
                                       
                                       s+= "<li><a name=" + res[i].id + " href='" +      "javascript:openGoogle()" + "'>"  + res[i].showlink +  "</a></li>"; 
                                                                        
                                       }
       $("#showList").html(s);
                                       $("#showList").listview("refresh")
                                       },"json");

The problem is that I would like reuse the res[i].showlink database variable in a javascript function (openGoogle) outside of the code above. When I go to reuse the database variable res[i].showlink, it no longer contains my data from the database. How can I reuse the variable outside of the jQuery/JSON code above? I really appreciate any suggestions. Thank you!