Các bạn lấy đoạn mã dưới đây chèn vào trước thẻ đóng </body> hoặc trước thẻ đóng </head> nhé
<script type=”text/javascript”><span data-mce-type=”bookmark” style=”display: inline-block; width: 0px; overflow: hidden; line-height: 0;” class=”mce_SELRES_start”></span>
jQuery(document).ready(function ($) {jQuery(document).mousedown(function (e) {
if (e.which === 3) {
ip_common_function();
alert(“Chuột phải không được phép sửa dụng trên trang này!”);}
});
});</script>
Đoạn mã chống dùng tổ hợp phím Ctr +C
<script type=”text/javascript”>
function sccopytext(e)
{
// alert(“hi”);
var select = ”;
var selected = false;
var newcontext = false;
var scalert = true;if (window.getSelection)
{
select = window.getSelection().toString();}
else if (document.getSelection)
{
select = docment.getSelection();
}
else if (document.selection)
{
select = document.selection.createRange().text;}
if (select !== ”)
//selected=true;
selected = true;document.oncontextmenu = function () {
// newcontext = true;
if ((selected === true)) {
jQuery(document).unbind(“copy”).bind(“copy”, function () {
ip_common_function();
alert(“Website chặn copy nội dung!”);// return false;
});}};
var isCtrl = false;
window.onkeydown = function (e)
{if (e.which === 17) {
isCtrl = true;
}if (isCtrl === true && (e.which === 67) && selected === true && newcontext != true)
{ip_common_function();
alert(“Website chặn copy nội dung!”);
return false
}}}
jQuery(document).ready(function () {
jQuery(document).bind(“mouseup”, sccopytext);
//sccopytext();
});</script>