Is it possible to Drag-and-Drop images between Web sites (applications)?
There are a number of questions on stackoverflow about drag-and-drop but I can't see that any relate to this question specifically.
Question: Is it possible to开发者_开发技巧 drag-and-drop an image from one Web application (or site) to another Web application (not the same window etc.)?
I'm not looking for specific technologies that may help one achieve this, just if it is possible with Web application security restrictions.
For example, I've read that it's not possible for one Web application's Javascript to mess with the DOM of another Web application (for obvious reasons).
I just want to be able to drag an image displayed on one Web page into a Web application on another page (and for that application to have full access to the image).
Thanks, Ashley.
Drag and drop is not defined within html. Many browsers (not IE IIRC) support drag and dropping image URL's into text boxes. So if you drag an image from a one site and drag it into another site's textbox you will have the full URL of the image. You can have JavaScript take it from there
I don't think this is directly possible without Gears.
EDIT: The Desktop API provides drag + drop.
It's really a question of data handling in the browser. If there were no security issues involved this would be a piece of cake ... but there are security issues, big ones. Any time you permit data from site X to be introduced to site Y in a programmatic way you are opening a door, and it's very difficult to find the right balance of "useful enough to permit exciting new functionality" without going all the way to "bending over in the shower in prison to pick up the soap".
Cheswick and Bellovin say there are two basic approaches to security:
That which is not explicitly forbidden is permitted.
That which is not explicitly permitted is forbidden.
Microsoft basically went with #1 and you can see where that leads to. Most paranoid sysadmins go the route of #2 with a vengeance. Opening a big door between two unrelated sites would send most of us screaming off into the woods.
Unfortunately, although browsers & web site people are mostly (somewhat?) aware of this problem and are trying to deal with it, companies like Adobe and their "flash storage" are creating more and more problems.
精彩评论