javascript - Clipping Magic API -
i trying use api clippingmagic running problem defining callback function. here code have it.
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" type="text/javascript"></script> <script src="https://clippingmagic.com/api/v1/clippingmagic.js" type="text/javascript"> </script> <script type="text/javascript"> var errorsarray = clippingmagic.initialize({apiid: ####}); if (errorsarray.length > 0) alert("sorry, browser missing required features: \n\n " + errorsarray.join("\n ")); clippingmagic.edit({ "image" : { "id" : ######, "secret" : "#############" } }, callback); </script>
if has worked api , can me, appreciated.
where defining callback
variable? don't see callback
resolve function you've defined.
clippingmagic.edit({ "image" : { "id" : response.image_id, "secret" : response.image_secret } }, function(response) { if(response.event == 'result-generated') { # response.image.id # response.image.image_secret } });
i created clipping magic plugin wordpress edit woocommerce product photos , snippet it.
Comments
Post a Comment