Marshall Tigerus
Marshall Tigerus

Reputation: 3764

Uncaught TypeError: Object [object Object] has no method 'listview'

I'm receiving a jquery (i believe) error that I cannot figure out.

The full error message in console is:

 Uncaught TypeError: Object [object Object] has no method 'listview' 

This is the snippet of code that is failing:

$.ajax({
type:"GET",
dataType:"json",
url:"viewapi.jsp",
success:function(images) {
    for (var i = 0; i < images.length; i++) {
        var image = images[i];
        addItem(image.id, image.title);
    }
    $("#allimages").listview('refresh');
}

And this is the HTML it is trying to manipulate

    <div data-role="content" class="photolist"> 
    <ul data-role="listview" data-inset="true" id="allimages"></ul>
</div>

I'm not certain why this code does not work, or where the error is coming from. Even if the get request returned nothing, it should error out before the line is it getting caught on

Upvotes: 0

Views: 386

Answers (1)

gaffleck
gaffleck

Reputation: 428

The listview function is presumably a plugin for jQuery. Has that plugin file been added to page in time? That error can mean a missing plugin.

Upvotes: 1

Related Questions