日期:2014-05-18  浏览次数:20357 次

请大家评评这个问题难不难?很矛盾的问题!
<body   oncontextmenu= "return   false "   ondragstart= "return   false "   onselectstart   = "return   false "   onselect= "document.selection.empty() "   oncopy= "document.selection.empty() "   onbeforecopy= "return   false "   onmouseup= "document.selection.empty() ">

我在我的网站 <body> 上用到了这些禁用选中和复制的属性,
但是又要在我的 <body> 里用到选中和复制,请问我应该怎么解决这个矛盾?

<script   type= "text/jscript "   language= "javascript ">
function   Select()   {  
document.all.TextMyURL.createTextRange().select();  
document.selection.createRange().execCommand( "Copy ");  
}
function   addFile()
{
var   str   =   ' <br> <INPUT   type= "file "   size= "50 "   NAME= "File "> '
document.getElementById( 'MyFile ').insertAdjacentHTML( "beforeEnd ",str)
} </script>

<table   style= "width:580px; "> <tr> <td     style= "width:580px; ">
  本高招宣传网址: <asp:TextBoxID= "TextMyURL "runat= "server "Width= "300px "> </asp:TextBox>
<input   type= "button "   name= "Submit "   value= "复制 "   onclick= "Select() "/>
</td> </tr> </table>

------解决方案--------------------
没太看懂,但我乱说一下,在JS中设置中间开关(即变量),自定义右键并在右键中设置开关状态。由于从来没有遇过这么变态的问题,没有现成的代码
------解决方案--------------------
的确很难,同情你!!!