Thursday, 15 April 2010

jquery - Grabbing, Resizing, and Displaying Image from JSON -



jquery - Grabbing, Resizing, and Displaying Image from JSON -

basically, i'm trying following:

a user enters id asset on our system the id submitted part of api phone call returns json field called "videostillurl", contains url thumbnail image. resize thumbnail image existing size smaller that, if right clicks , saves hard drive, resized version , not original.

i'm not sure if possible... can bits , pieces of it, haven't been able set , thought i'd see if had insight.

below format of json returning. i'm having hardest time figuring out how load image url videostillurl item, because url has slashes in it.

{"name":"test item","videostillurl":"http:\/\/brightcove.vo.llnwd.net\/d21\/unsecured\/media\/1547387903001\/1547387903001_2146991932001_vs-5112b14ee4b0a4075c1c8334-1592194027001.jpg?pubid=1547387903001","thumbnailurl":"http:\/\/brightcove.vo.llnwd.net\/d21\/unsecured\/media\/1547387903001\/1547387903001_2146991933001_th-5112b14ee4b0a4075c1c8334-1592194027001.jpg?pubid=1547387903001"}

any help appreciated!

extra slashes shouldn't issue escaped.

let you're doing mockup:

$(document).ready(function() { ... ajaxsuccesscallhere(data) { var image = $("<img/>"); $(image).attr('src', data.thumbnailurl) $(document.body).append(image); } ... });

what find impossible do, in you're trying achieve, making save videostillurl when right clicking on image alone. how i'd wrap <a href='[videostillurl]'> tag around image - right clicking, , picking "save source" save original image , not thumbnail

jquery

No comments:

Post a Comment