getJSON not ready with returning data before showing the data
<p>something strange here: I use a $.getJSON to get data from the database. It returns valid data, but it doesn't show in the inputbox afterwards. When I insert an alert("bla") after the json call, it does show the data. My assumption is that the json call isn't ready yet when showing the data on the page. Is there a way to wait for the json call to finish? This is my code:</p>

<pre><code>    $.getJSON("mvc/models/predictions.php?action=getpredictions&amp;jsoncallback=?", function(data) {

            // Replace markup on page
            prediction[1] = data[0].prediction1; 
        });

        // Create output
        &lt;input type='text' name='prediction1' size='5' value='" + prediction[1] + "' /&gt;
</code></pre>
