Click here to Skip to main content
15,898,134 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi,
I have to copy data to clipboard.
I have used following code,


var clipboarddiv=document.getElementById('divclipboardswf');  
     if(clipboarddiv==null)  
     {  
        clipboarddiv=document.createElement('div');  
            clipboarddiv.setAttribute("name", "divclipboardswf");  
        clipboarddiv.setAttribute("id", "divclipboardswf");  
        document.body.appendChild(clipboarddiv);  
     }  
         clipboarddiv.innerHTML='<embed src="../javascript/clipboard.swf" FlashVars="clipboard='+  
 encodeURIComponent(strResult)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>';  
       
     alert('The text is copied to your clipboard...'); 	



But it is not working.
for IE
window.clipboardData.setdata("Text",strResult)

it is working but not for another browser.


please help me
Posted

 
Share this answer
 
whatch the source code of this same page.
you have : "Colapse | Copy Code"
:)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900