Access a parameter in Javascript
<p>i've a strange problem with JS (probably a noob bug), but i'm stuck with it</p>

<p>In function <code>fillInVersionsList</code>, if i put an <code>alert("tempo")</code> or a break in firebug, i can access to my datas in parameter (ie : <code>alert(pSimulator.simulatorData['LastVersion'])</code> and i've the right result. The problem is that if  i don't put an alert/firebug break before my access to datas, i've a JS error  <code>pSimulator.simulatorData is undefined</code>.</p>

<pre><code>$(document).ready(function() {

    var simulator = new Simulator();

    // Load SimulatorData into the simulator class
    initSimulatorData(simulator);
    // Fill in datas into VersionsList (2nd arg = Id of the list)
    fillInVersionsList(simulator, $('#VersionsList'));  


});

function initSimulatorData(pSimulator)
{
    $.ajax({
      url: "getData.php?action=init",
      success: function(data) {
          pSimulator.initSimulatorData(data);
        }

    });

}


function fillInVersionsList(pSimulator, pSelect)
{
    //alert("tempo");
    alert(pSimulator.simulatorData['LastVersion']);

    pSelect.html('&lt;option&gt;test&lt;/option&gt;')       

}

function Simulator()
{

    var simulatorData;


    this.initSimulatorData = function(pSimulatorData)
    {
        this.simulatorData = pSimulatorData;    
    }




}
</code></pre>

<p>Is there something to solve this problem?</p>

<p>Thanks in advance</p>
