empty() then run the rest of the funtion
<p>I have some json that's loaded into <strong>li.ui-state-default</strong> pending user entry. </p>

<p>The user can then enter a new entry. I want it to empty <strong>li.ui-state-default</strong> everytime a new entry is loaded but it seems to just stay empty.</p>

<pre><code>//data for DOM
var timeout = '';
$('.call-json').keyup(function () {
    clearTimeout(timeout);
    var val = this.value;
    timeout = setTimeout(function () {
        $('.ui-state-default').empty();
        $.getJSON('json/' + val + '.json', function (data) {
            // load data

            var items = [];
            for (key in data[0].attributes) {
                if (key.match('.stat.prop.type')) {
                    items.push(data[0].attributes[key])
                }
            };

            displaySortLabel(items, "type-details");

        function displaySortLabel(items, parentClass) {
                $('&lt;span/&gt;', {
                    'class': 'el-data',
                    html: items.join('')
                }).hide().fadeIn().appendTo('.' + parentClass + ' .sort-label');
            }
</code></pre>
