我正在使用javascript来禁用我的网站上的文本选择.
代码是:
<script type="text/JavaScript">
function disableselect(e) {
return false
}
function reEnable() {
return true
}
document.onselectstart = new Function ("return false")
if (window.sidebar) {
document.onmousedown = disableselect
document.onclick = reEnable
}
</script>
Run Code Online (Sandbox Code Playgroud)
类似的脚本可以在这里找到:http://rainbow.arch.scriptmania.com/scripts/no_right_click.html
在我的本地主机上:所有浏览器(Firefox,Chrome,IE和Safari)运行良好.
在我的Live网站上:除了Firefox之外一切正常.
我的问题是:
有没有人建议为什么Firefox对于实时站点和本地主机的行为不同.注意:Javascript已启用.
也许我的脚本过于简单,所以我尝试了以下完全相同的结果:http://freeware.ke-zo.com/CODES/DisableRC.txt
javascript ×1