Sometimes to protect our website content from copy-paste & miss use of it or protect it from spam uses need some security. To check the code of webpage "Ctrl+U" is use.
Below is given method to stop this code by script.
Simply Add this code.
Here Script is stop "Ctrl+U" by key code.
Just put following code in Header section <head> tag.
<!--------- Put this code in "<head>" tag ------------->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>
document.onkeydown = function(e) {
if (e.ctrlKey &&
(e.keyCode === 67 ||
e.keyCode === 86 ||
e.keyCode === 85 ||
e.keyCode === 117)) {
return false;
} else {
return true;
}
};
$(document).keypress("u",function(e) {
if(e.ctrlKey)
{
return false;
}
else
{
return true;
}
});
</script>
For more Interesting, Useful Article & codes visit IT New Code.
Below is given method to stop this code by script.
Simply Add this code.
Here Script is stop "Ctrl+U" by key code.
Just put following code in Header section <head> tag.
<!--------- Put this code in "<head>" tag ------------->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>
document.onkeydown = function(e) {
if (e.ctrlKey &&
(e.keyCode === 67 ||
e.keyCode === 86 ||
e.keyCode === 85 ||
e.keyCode === 117)) {
return false;
} else {
return true;
}
};
$(document).keypress("u",function(e) {
if(e.ctrlKey)
{
return false;
}
else
{
return true;
}
});
</script>
For more Interesting, Useful Article & codes visit IT New Code.
0 comments:
Post a Comment