How to remove clipboard JavaScript?

Asked By 50 points N/A Posted on -
qa-featured

Hi techyv,

How to remove clipboard javascript? We as a team in our java programming class are having a problem on removing the clipboard using the javascript code. I know some of you are experts when it comes to javascripting. How I wish you can help us solve this problem.

Hoping for your help.

SHARE
Answered By 0 points N/A #185788

How to remove clipboard JavaScript?

qa-featured

Hello Curtis,

Hope this will helps you to solve your problem.

<HEAD>

    <script language="javascript">

      function clearClipboard(){

            window.clipboardData.setData('text','')

      }

      function checkClipboardData(){

          if(clipboardData){

               clipboardData.clearClipboard();

           }

      }

      setInterval("checkClipboardData();", 4000);

     </script> 

</HEAD>

<body  oncontextmenu="return false;" ondragstart="return false;" onselectstart="return false;" onblur="clearClipboard();" onload="clearClipboard();">

This will clear the clipboard data for every 4seconds. Or else you can call the checkClipboardData() function whenever you need to clear the clipboard data.

Related Questions