开发者

How can I use clippy to copy an iframe embed code without the iframe displaying

I have an embed code that users will use to display content hosted on my website on their own site (e.g. <iframe src="mysite/feed"></iframe>).

I want to use clippy to allow them to copy the embed code to their clipboard but in firefox this results in the iframe actually getting embedded in the page beside the clippy icon.

My site is written in PHP and I'm also using jquery.

Is there any way of escaping the embed cod开发者_Go百科e so that it doesn't get embedded in my page but still copies to the clipboard correctly for the user?

Chrome is behaving correctly and not displaying the iframe, not tested in ie.


In order to display the html you'll have to convert some characters to their entities 'less than' and 'greater than' on that line.

&lt;iframe src="mysite/feed"&gt;&lt;/iframe&gt;

This is the output of the above text:

<iframe src="mysite/feed"></iframe>

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜