最新国产好看的视频,伊人天堂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
宿州市| 邯郸县| 嘉兴市| 买车| 高青县| 无棣县| 新竹市| 无为县| 五河县| 扶沟县| 西平县| 中山市| 营口市| 钟祥市| 兖州市| 岚皋县| 松潘县| 吉林省| 离岛区| 阳谷县| 平潭县| 明溪县| 黄浦区| 平舆县| 商南县| 虎林市| 霍城县| 商都县| 蓬溪县| 沂水县| 漠河县| 仪征市| 齐河县| 浪卡子县| 武陟县| 江阴市| 工布江达县| 云和县| 五台县| 明星| 滨州市|