If url is assigned manually, for example imgUrl="http://image.jpg" it works perfectly, but if it received with the use of AJAX in function "getRemote" from back end it didn't. If the request asynchronous it's not even in this block, but if it synchronous it is received, but AR object cannot use it. Any ideas why?
var imgUrl = getRemote();
this.img = new AR.ImageResource(imgUrl);
this.imgOverlay = new AR.ImageDrawable(this.img, 0.5, {
offsetX: 0,
offsetY: 0,
});
getRemote function:
function getRemote() {
return $.ajax({
type: "GET",
url: "http://someurl.php",
async: true
}).responseText;
}