function str2Meroy( str )
{
var printWindow=window.open("","printWindow","width=10,height=10,left=10000,top=10000");
printWindow.document.write( str );
printWindow.document.execCommand( "selectall" );
printWindow.document.execCommand( "copy" );
printWindow.close();
}
这段代码能直接把参数str复制到剪贴板,你只要把字符串onclick此方法,把要复制到剪贴板的字符串做参数传进去就可以了
{
var printWindow=window.open("","printWindow","width=10,height=10,left=10000,top=10000");
printWindow.document.write( str );
printWindow.document.execCommand( "selectall" );
printWindow.document.execCommand( "copy" );
printWindow.close();
}
这段代码能直接把参数str复制到剪贴板,你只要把字符串onclick此方法,把要复制到剪贴板的字符串做参数传进去就可以了
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货