1

I am using jquery mobile and I have an array makeArray in jquery and I have created few listview by the values of the array.Everything works fine.But the jquery mobile styled list-view is not shown. Rather it is shown an ordinary list view with no style. This is my code:

$(document).ready(function(){
        var url = "inventory/inventory.json";
        var makeArray = new Array();
        $.getJSON(url, function(data){
            $.each(data, function(index, item){
                if(($.inArray(item.make, makeArray)) == -1){
                    makeArray.push(item.make);
                    $('.upper_case')
                    .append('<li data-icon="list-arrow"> <a href="trade_form.php?='+ item.make +'"><img src="images/car_logo/buick.png" class="ui-li-thumb"/>' + item.make + '</a></li>');
                }
            });
        });
      });

1 Answer 1

4

You need to refresh the listview:

  $('upper_case').listview('refresh');
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks man! I was becoming frustrated with it.Really stack overflow is awesome for some helpful guys like you :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.