久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

從另一個網站拖放圖像到我的

Drag and Drop images from another website to mine(從另一個網站拖放圖像到我的)
本文介紹了從另一個網站拖放圖像到我的的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

我在 Google 和 SO 上進行了快速搜索,發現了類似的問題,但沒有一個問題是正確的,而且大多數都是舊的,看起來被遺棄了(沒有答案,有一段時間沒有評論).所以就到這里了……

I ran a quick google and SO search and found similar questions but none were well formed and most were old and looked abandoned (no answers, and no comments for a while). So here goes...

我希望能夠收集從另一個網站拖放到我的網站上的圖像的 url(僅 url)..(即我打開了兩個 chrome 窗口.窗口 A 中有我的應用程序.窗口 B 有imgur 在其中.我打開一個圖像單擊并將其拖動到我的窗口并松開.現在我需要知道放置在我的頁面上的圖像的 url).

I want to be able to collect the url (only the url) of an image being dropped onto my site from another website.. (i.e. I have two chrome windows open. Window A has my application in it. Window B has imgur in it. I open an image click and drag it to my window and let go. Now I need to know the url of the image dropped on my page).

這是我用于本地文件的代碼.

Here is the code I was working with for local files.

$(document).on('drop', function(e) {
    var data = e.dataTransfer || e.originalEvent.dataTransfer;
    console.log(data); // data.files is empty
    e.preventDefault();
    return false;
});?

再次,我不想上傳任何東西..我不想做任何花哨的事情...我只需要知道從另一個網站拖放到頁面上的圖像的位置.

Again I do not want to upload anything.. i'm not trying to do anything fancy... I just need to know the location of the image being dropped on the page from another website.

推薦答案

試試這個:http://jsfiddle.net/2Jet2/70/

$(document).on('dragover', function(e) {
     e.preventDefault();
});
$(document).on('drop', function(e) {
    e.preventDefault();
    e.originalEvent.dataTransfer.items[0].getAsString(function(url){
        alert(url);
    });
});?

我得到 "http://static3.flattr.net/thing/image/9/4/5/5/0/huge.png?1326712342" 當我從另一個拖動該圖像時瀏覽器窗口.

I get "http://static3.flattr.net/thing/image/9/4/5/5/0/huge.png?1326712342" When I dragged that image from another browser window.

.getAsString 接受一個回調,一旦它被調用,它就會獲取 url 作為參數

.getAsString takes a callback which gets the url as argument once it's called

無法在火狐上運行

這篇關于從另一個網站拖放圖像到我的的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

How can I get my jasmine tests fixtures to load before the javascript considers the document to be quot;readyquot;?(在 javascript 認為文檔“準備好之前,如何讓我的 jasmine 測試裝置加載?) - IT屋-程序員軟件開發技術
What do jasmine runs and waitsFor actually do?(jasmine 運行和等待實際上是做什么的?)
How to provide mock files to change event of lt;input type=#39;file#39;gt; for unit testing(如何提供模擬文件來更改 lt;input type=filegt; 的事件用于單元測試)
How to unit test a chained method using Jasmine(如何使用 Jasmine 對鏈式方法進行單元測試)
How do I inject $rootScope into an AngularJS unit test?(如何將 $rootScope 注入 AngularJS 單元測試?)
Jasmine - How to spy on a function call within a function?(Jasmine - 如何監視函數中的函數調用?)
主站蜘蛛池模板: 在线播放亚洲 | 在线观看视频福利 | 亚洲成人久久久 | 中文字幕免费在线 | 日韩成人 | 中国免费黄色片 | 欧美一区二区三区在线视频 | 亚洲va中文字幕 | 一区二区三区国产精品 | 久久88 | 日韩av在线一区二区 | 亚洲精品第一 | 成人久久18免费网站 | www.久 | 国产区视频在线观看 | 精品1区 | 国产精品免费一区二区三区四区 | 亚洲一区播放 | 99福利视频 | 人人色视频 | 免费观看一区二区三区毛片 | 日本久草| 国产精品无码专区在线观看 | 日韩精品一区二区三区视频播放 | a级性视频 | 日本h片在线观看 | 欧美日韩国产一区二区三区 | 亚洲国产欧美国产综合一区 | 国产高潮好爽受不了了夜夜做 | 亚洲一区二区三区在线视频 | 成人精品一区 | 日本精品一区二区三区在线观看视频 | 婷婷一级片 | 成人做爰www免费看视频网站 | 亚洲一区二区在线播放 | 亚洲精品二区 | 99免费看| 国产精品视频一区二区三区不卡 | 麻豆久久久9性大片 | 精品蜜桃一区二区三区 | 亚洲精品一区在线观看 |