IE clipboard access under
Advertisements
window.clipboardData.getData(type): Gets the data ; window.clipboardData.setData(type, value): Sets the data for the value; window.clipboardData.clearData(): Clear data ; type Typically evaluates to ' Text ', indicating that the text formatting . Another value is ' URL ', URL Format .
Related events:
beforecopy, copy, beforecut, cut, beforepaste, paste
We can beforecopy, beforecut, beforepaste processing function to change the clipboard's contents, but to cancel the event, you must copy, cut, paste function for the event.
Examples:
document.forms[0].elements['area1'].attachEvent('onpaste',function(){
var data = window.clipboardData.getData('Text');
if(!/^\d*$/.test(data)){
window.event.returnValue = false;
}
});
document.body.attachEvent('oncopy',function(){
window.event.returnValue = false;
window.clipboardData.setData('Text',' Replication is not valid ');
});
See more effective only in IE, other browsers view of security issues, does not allow access to clipboard or set of related constraints. Want to copy the contents to the clipboard, an implementation method is to use the flash, to copy the code to javaeye achieved. Later learning.
Related Posts of IE clipboard access under
-
Firebug Guide (b) --- how to use the Firebug command line API to provide debugging js procedures (on)
Console Tab Overview This tag is mainly used to print the log only. It can also be a time when debugging in javascript as a command-line window to use (similar to Microsoft Visual Studio in the window immediately (immediate window)). And the use of its
-
xKungfoo on the Net indecent horse skills
XKungfoo today the last day, G in the above linked to make a horse industry chain issues. Some hang indecent horse skills did not say in detail, where the open bar. In fact, some not, that is, skills, and some people have played. The first in a horse hang
-
js a small script
Removal of elements:
-
javascript basic object-oriented technology (iv)
Category, constructor, prototype First to illustrate the point: In the above mentioned elements, each a function contains a prototype property, this property points to a prototype object (Every function has a prototype property that refers to a prede ...
-
The second stage of examination (HTML.Servlet.JSP.Javascript.Ajax.JQuery)
------------------------------------- Following is the pen questions (questions 2 points each) --- --------------------------------------------- 1. The use of HTTP protocol client request sent to the server-side which has two ways? Please describe briefly
-
js Simplified Traditional conversion code
js Traditional Traditional Traditional Traditional javascript code conversion conversion code Reprint Address: http://www.cnblogs.com/genson/archive/2008/04/16/1004632.html js Simplified, Traditional conversion, IE7 through, Firefox does not pass, the pos
-
javascript form
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>formUtil.html</title> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="thi
-
js commonly used in integrated
/ / Open the model dialog box function doSelectUser (txtId) ( strFeatures = "dialogWidth = 500px; dialogHeight = 360px; center = yes; middle = yes; help = no; status = no; scroll = no"; var url, strReturn; url = "selUser.aspx"; strRetu
-
js version of Ant Colony Algorithm
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><HEAD> <meta http-equiv="Content-Type" content="text/html; charset=gb
-
javascript built-in functions Info
48. In the old browsers do not perform this JS :<!-- //--> 49. To quote a document-style JS: <script type="text/javascript" src="/blog/aaa.js"> </ script> 50. Specified in the script does not support the browser displ












