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?ThanksIf 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.
精彩评论