开发者

Is there any way to read the image in the page using javascript

I wonder if there's any way to read the images in the web page cause I want to make a small plugin that can upload them to my server, First,I set the images draggable and then I drap them to a small "box" and upload them, Maybe the File API in HTML5,But I found it can only read local file unfortuna开发者_开发问答tely,

Anyone get some ideas?Thanks


If you want to deal with images (croping, resizeing etc) you have to use HTML5 <canvas> element. But if you just want to have an image element, you can use this:

var myImg = new Image();
myImg.src = "url_to_image";


If I understand you correctly, you want to copy images from some page to your server? You can get page source, all images links and display it in javascript, but to upload it to your server you have to use one of server side languages like e.g. PHP.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜