最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

getData Method

Internet Development Index

Retrieves the data in the specified format from the clipboard through the dataTransfer or clipboardData objects.

Syntax

sRetrieveData = object.getData(sDataFormat)

Parameters

sDataFormat Required. String爐hat specifies one of the following data format values:
TextRetrieves data formatted as text.
URLRetrieves data formatted as a URL.

Return Value

String. Returns the data in the format retrieved from clipboard through the dataTransfer or clipboardData object. Depending on the information contained in setData, this variable can retrieve a path to an image, text, or an anchor URL.

Remarks

The getData method enforces cross-frame security and allows data transfers within the same domain only. To the user this means that dragging a selection between different security protocols, such as HTTP and HTTPS, will fail. In addition, dragging a selection between two instances of the browser with different security levels, where the first instance is set to medium and the second is set to high, will fail. Finally, dragging a selection into the browser from another drag-enabled application, such as Microsoft® Word, also will fail.

To use the getData method to retrieve data from the clipboard within the oncopy or oncut event, specify window.event.returnValue=false within the event handler script.

Examples

The following examples use the setData and getData methods of the dataTransfer object to drop text in a new location and create a desktop shortcut.

This example uses the getData method to drag text and drop it in a new location.

<HEAD>
<SCRIPT>
function InitiateDrag(){
event.dataTransfer.setData(oSource.innerText);
}
function FinishDrag(){
window.event.returnValue=false;
oTarget.innerText = event.dataTransfer.getData("Text");
}
function OverDrag(){
window.event.returnValue=false;
}
</SCRIPT>
</HEAD>
<BODY>
<B ID="oSource"
ondragstart="InitiateDrag()">
drag this text</B>
<SPAN ID="oTarget"
ondragover="OverDrag()"
ondragenter="FinishDrag()"">
drop text here</SPAN>
</BODY>
This feature requires Microsoft® Internet Explorer 5 or later. Click the following icon to install the latest version. Then reload this page to view the sample.

This example uses the getData method to create a desktop shortcut using a drag-and-drop operation.

<HEAD>
<SCRIPT>
function InitiateDrag(){
event.dataTransfer.setData("URL", oSource.href);
}
function FinishDrag(){
oTarget.innerText = event.dataTransfer.getData("URL");
}
</SCRIPT>
</HEAD>
<BODY>
<A ID=oSource HREF="about:Example_Complete"
onclick="return(false)" ondragstart="InitiateDrag()">Test Anchor</A>
<SPAN ID=oTarget ondrop="FinishDrag()">Drop Here</SPAN>
</BODY>
This feature requires Microsoft® Internet Explorer 5 or later. Click the following icon to install the latest version. Then reload this page to view the sample.

Standards Information

There is no public standard that applies to this method.

Applies To

clipboardData, dataTransfer

See Also

About DHTML Data Transfer, clearData, setData
城口县| 中江县| 崇信县| 万州区| 建瓯市| 内江市| 微博| 休宁县| 武威市| 东辽县| 钦州市| 建湖县| 桐柏县| 平顶山市| 涿鹿县| 仙游县| 清河县| 鄂尔多斯市| 承德县| 阿拉尔市| 南安市| 扬州市| 潜江市| 会昌县| 宿州市| 呼玛县| 来凤县| 金华市| 南城县| 伊金霍洛旗| 灌云县| 阿克| 鄯善县| 古丈县| 鸡西市| 张家界市| 寿光市| 太谷县| 思茅市| 将乐县| 吴忠市|