jQuery plugin variable returns nothing
===

In my init method I am storing a new instance of a class called "Preview" for each element with the help of the data() method, like this:

    $(this).data("preview", new $.Preview(this, settings));

The Preview class contains some functions to fetch data from a php script and populate a couple of variables. Now I need to access one of the variables(siteinfo) from another script(regular js file). I do that like this in a click event: 

    $("#input").data("preview").siteinfo;

siteinfo is beeing populated with the return value from an ajax call in the Preview class during init. When I try to access it like above it returns empty even though I wait for the ajax call to be completed before I click the button to get the value. 

If I set the value of siteinfo explicit to siteinfo = "test" the value is there when I press the button.

I first thought that this had something to do with some ajax callback functions but that should not matter because I wait for the call to be completed before I click the button.
And I know that the variable is beeing populated correctly because I can print it in the ajax success callback(where it also is beeing set).

Do you guys have any ideas of how I could solve this? Let me know if you need more information. Thanks in advance!