I'm trying to access the JSON response from the Bing API using Knockout.js. Below is my javascript code and the corresponding Knockoutjs bindings I'm using in the html. I also included a screenshot of the object I'm trying to access. From the object I need to get Thumbnail.Url and assign that value to the HREF attributes on the page. Can someone spot what I've done wrong? I think the problem is likely in my attr bindings.

JS

```
function bindModel(data) {
var viewModel = ko.mapping.fromJSON(data);
ko.applyBindings(viewModel);

}

$.ajax({
                url: fullUri,
                type: 'post',
                dataType: 'jsonp',
                jsonp: true,
                jsonpCallback: 'searchDone',
                success: function(data, textStatus, jqXHR){
                    console.log(data);
                    bindModel(data);
                }
})

```

HTML

```
    <ul class="thumbnails" data-bind="foreach: Image.Results">
    <li class="span2"><img data-bind="attr: {href: Thumbnail.Url}"></img></li>
    </ul>

```

CONSOLE SCREENSHOT

![enter image description here](https://i.stack.imgur.com/I6yez.png)
['https://Stackoverflow.com/questions/10037932', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/549273/']
Couple of things.

If you are binding the object in your console directly then you will need to be referencing from the property `SearchResponse` since that would be the first property in your viewModel.

Also an image tag is normally self closing, minor gripe, it does however not use `href` instead you should be setting `src`.

The correct markup would be.

```
<ul class="thumbnails" data-bind="foreach: SearchResponse.Image.Results">
    <li class="span2"><img data-bind="attr: {src: Thumbnail.Url}" /></li>
</ul>

```

Your use of the mapping plugin I believe should be using fromJS since I'm pretty sure jquery will take care of parsing the json string into an object so your data value is not a raw string anymore at this point.

The correct bind method would therefore be.

```
function bindModel(data) {
    viewModel = ko.mapping.fromJS(data);
    console.log(viewModel);
    ko.applyBindings(viewModel);
}

```

Here's a fiddle.

<http://jsfiddle.net/madcapnmckay/udDGP/>

Hope this helps.
`img` tags use `src` instead of `href`. You would want to do `attr: { src: Thumbnail.Url }`