jquery $.ajax load in UI dialog() problem
Posted
by
alex
on Stack Overflow
See other posts from Stack Overflow
or by alex
Published on 2011-01-31T06:35:06Z
Indexed on
2011/01/31
7:25 UTC
Read the original article
Hit count: 125
i have a working bing Image search api with jsonp datatype. It's working with no problems. When i load the image search script in a Jquery UI dialog, it display properly and i'm able to search and see the results in the dialog() box. But if i close the dialog() and open it again, now if i search no results show. Looking at console.log, i do confirm the jason data is recieved, but for some reason it's not appending to the result div, so i see no result on the screen. This onyl happens if i close the dialog and open it again. If i refresh refresh the page and open the dialog again then search results are displayed.
This is what i'm using to append the results.
$.each(data.SearchResponse.Image.Results,
function(i, item) {
console.log(item.Thumbnail.Url);
$("#Results").append("<li><img style='width:100px; height:75px;' src='" + item.Thumbnail.Url + "'/></li>");
});
© Stack Overflow or respective owner