问题描述
大家好,
我想知道复制到剪贴板是否适用于iframe.我试图在谷歌搜索,没有喜悦.有人可以请教吗?
提前谢谢.
好的,所以我有一个网站,并且已经有一个复制到剪贴板的选项,我使用Javascript代码可以正常工作,但是现在我有了iframe,复制到剪贴板的功能不再起作用.我有一个html网站.我有一个基于Web的页面(html框架格式),用于我们关于各种主题的文本文档文章.该页面分为三帧.就像这样的"http://www.w3schools.com/html/tryit.asp?filename=tryhtml_frame_mix".复制到剪贴板选项适用于主菜单中显示的文章.
代码是:
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>
对于iframe,我正在使用它:
For iframe i am using this :
<iframe src="text.txt" frameborder="0" scrolling="yes" height="400" width="650">
Text file not found.
</iframe>
推荐答案
这篇关于向iframe复制到剪贴板的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!