views:

42

answers:

1

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 code 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.

A: 

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>

Codex73