1 Reply Latest reply: Jun 18, 2014 11:45 AM by aidreamer RSS

    Display image in WebView from external directory

    d2db817b-be7a-4f5c-82bb-8ac07eab9c79

      I have a WebView and a Javascript that appends an <img> tag in a webview.

       

      Like so:

       

      function insertImg(src) {

         $("body").append("<img src='" + src + "'/>");

      }

       

      I call this function with the following code:

       

      String path = "file://Users/rod/Desktop/123.gif";

      webengine.executeScript("insertImg('" + path + "')");

       

      However, this does not work and no image is displayed.

       

      How can this be achieved?

       

      Thanks in advance.