有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

javascript{“错误”:[“无效图像URL”]}与鸟舍集成

我正在与Aviary进行图像编辑集成。 下面是html代码

<body>
 <a href="#" onclick="return launchEditor('editableimage1','http://www.html5canvastutorials.com/demos/assets/darth-vader.jpg');">
 <img id="editableimage1" src="http://www.html5canvastutorials.com/demos/assets/darth-vader.jpg"/></a>
    <br>
    <form id="myform" action="" method="post">
<input id="hf" type="hidden" name="url">
<input type="submit" value="Save" />
</form>

<script type="text/javascript" src="http://feather.aviary.com/js/feather.js"></script>


<!-- Instantiate the widget -->
<script type="text/javascript">

    var featherEditor = new Aviary.Feather({
        apiKey: '1234567',
        apiVersion: 3,
         theme: 'light',
        tools: ['draw','text'],
        onSave: function(imageID, newURL) {
            var img = document.getElementById(imageID);
            img.src = newURL;
            console.log('newURL '+newURL);
            document.getElementById("hf").value=newURL;
            featherEditor.close();
            //document.forms["myform"].submit();
        }
    });
    function launchEditor(id, src) {
        featherEditor.launch({
            image: id,
            url: src
        });
        return false;
    }
</script>                         
 </body>

打开上述html时:

  1. 图像将被渲染
  2. 单击图像,图像编辑工具将打开,其中包含图像

但是如果我用任何其他图像url替换url,比如http://ipaddress:8080/ImageCheck/imgjsp.jsp,它实际上会在浏览器中呈现图像

  1. 图像将被渲染
  2. 点击图像后,图像编辑工具立即打开并关闭,错误为{"errors":["Invalid image URL"]}。工具无法从我的UrL将图像输入其服务器进行编辑

http://ipaddress:8080/ImageCheck/imgjsp.jsp”和“http://www.html5canvastutorials.com/demos/assets/darth-vader.jpg”之间的区别是什么?工具的行为会有所不同。感谢您的帮助


共 (0) 个答案