I had implemented copy to clipboard functionality. It is working fine with all version on IE but not working in FireFox. Please help me solve out this problem. Detail are
<script src="../../Scripts/JQPlugins/jquery.clipboard.js" type="text/javascript"></script>
<script src="../../Scripts/JQPlugins/jquery.clipboard.pack.js" type="text/javascript"></script>
<script type="text/javascript">
$.clipboardReady(function() {
$("input#buttonid").bind('click', function() {
var text = $("#url").attr("href") + "\n" + $("#pwd").html();
$.clipboard(text);
alert("hi");
return false;
});
}, { swfpath: "../../Scripts/JQPlugins/jquery.clipboard.swf", debug: true });
</script>
And my code file structure is
Project > Scripts > JQPlugins >
1. jquery.clipboard.js
2. jquery.clipboard.pack.js
3. jquery.clipboard.swf
The method you're using to copy text to the clipboard is the jQuery clipboard plugin; it uses IE's native abilities to copy text to the clipboard, but uses a Flash plugin on non-IE platforms. My bet is that you have Flash 10 on your machine, or at least on the machine you're testing Firefox on -- Flash 10 no longer allows clipboard manipulation without explicit user request, which is likely why you're seeing it not work on Firefox. (This is even mentioned in the release notes for the plugin.)
That being said, people have already figured out a workaround for the security restrictions; the workaround involves placing an invisible Flash movie atop the DOM element of your choice, which means that when the user clicks or otherwise invokes the element to submit data, the Flash movie registers that the user took explicit action, and allows the clipboard manipulation. Zero Clipboard is one such library providing the workaround, but there are others out there if you look for 'em.