I'm using ZeroClipboard for making a copy to clipboard link in my website.
Here is a small sample :
<html>
<head>
</head>
<body>
<script type="text/javascript" src="jquery/js/jquery.js"></script>
<script type="text/javascript" src="jquery.zclip.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#copy-hc').zclip({
path:'ZeroClipboard.swf',
copy:$('#hc').attr('href')
});
$('#copy-ez').zclip({
path:'ZeroClipboard.swf',
copy:$('#ez').attr('href')
});
$('#copy-hcref').zclip({
path:'ZeroClipboard.swf',
copy:$('#hcref').attr('href')
});
});
</script>
<a id="ez" href="http://domain.com/ez">Some text here!!!</a>
<a href="#" id="copy-ez">Copy To Clipboard</a>
<a id="hc" href="http://domain.com/hc">Some text here!!!</a>
<a href="#" id="copy-hc">Copy To Clipboard</a>
<table>
<tr>
<td><a id="hcref" href="http://domain.com/hcref">hcref</a></td>
<td><a href="#" id="copy-hcref">Copy To Clipboard</a></td>
</tr>
</table>
</body>
</html>
The first two copy to clipboard links are working absolutely prefect(id copy-ez and copy-hc)
But, the third link which has id copy-hcref isn't working. I copied it and pasted it outside the table and its working perfectly, but as I put it inside the table, its not working.
Here's a snippet of it working :
<html>
<head>
</head>
<body>
<script type="text/javascript" src="jquery/js/jquery.js"></script>
<script type="text/javascript" src="jquery.zclip.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#copy-hc').zclip({
path:'ZeroClipboard.swf',
copy:$('#hc').attr('href')
});
$('#copy-ez').zclip({
path:'ZeroClipboard.swf',
copy:$('#ez').attr('href')
});
$('#copy-hcref').zclip({
path:'ZeroClipboard.swf',
copy:$('#hcref').attr('href')
});
});
</script>
<a id="ez" href="http://domain.com/ez">Some text here!!!</a>
<a href="#" id="copy-ez">Copy To Clipboard</a>
<a id="hc" href="http://domain.com/hc">Some text here!!!</a>
<a href="#" id="copy-hc">Copy To Clipboard</a>
<a id="hcref" href="http://domain.com/hcref">hcref</a>
<a href="#" id="copy-hcref">Copy To Clipboard</a>
</body>
</html>
But I need it to work from within a table. Perhaps some help?