Jump to content

Issue With Copy To Clipboard For Iframe

Recommended Posts

Hi All, I was wondering if copy to clipboard is available for iframe. i tried to search on google and no joy. Could somebody please advise?Thanks in advance. Ok So I am having a website and there was already a copy to clipboard option for which i used Javascript code and that worked perfectly fine but now i have iframe and the copy to clipboard function does not work anymore. I have a html website. I have a web based page(html- frames format) for our text documents articles on various subjects. The page is made in three frames. It's exactly like this "http://www.w3schools.com/html/tryit.asp?filename=tryhtml_frame_mix". The copy to clipboard optionis for the articles displayed in the main menu.The code is:

<SPAN ID="copytext" STYLE="height:;width:;background-color:"><p>Please do the following:<br />					1. Click on Edit > Preferences<br />					2. Select the Multimedia Trust (legacy) Category on left side of window<br />					3. Select 'Other Documents' under 'Trust Options' frame<br />					4. Select 'Permission for Adobe(R) Flash(R) Player is set to Prompt' in<br />					list box<br />					5. Change value for Change permission for selected multimedia player<br />					to: 'Always'<br />					6. Click 'OK'				  </p>				  <p>Kind Regards,</p></SPAN><TEXTAREA ID="holdtext" STYLE="display:none;"></TEXTAREA><BUTTON onClick="ClipBoard();">Copy to Clipboard</BUTTON>

<script LANGUAGE="JavaScript"> function ClipBoard(){holdtext.innerText = copytext.innerText;Copied = holdtext.createTextRange();Copied.execCommand("RemoveFormat");Copied.execCommand("Copy");} </SCRIPT>

For iframe i am using this :

<iframe src="text.txt" frameborder="0" scrolling="yes" height="400" width="650">  Text file not found.</iframe>

Edited by cynosure1023
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...