Emphasizing that all two are bad practices, follow the answers:
About blocking the command to see the source code
It is not possible to prevent the user from inspecting the code (view-source :) running on the machine. After all, the HTML they will receive will be readable in plain text. You may cause a nuisance to most people, but this will not be a valid security measure - chrome extensions will still be run, for example, so if someone is using the NoScript extension, they will disable all javascript.
A much better option would be to deal with your logic server, and just send the client the information they need to know / request.
There are some free javascript obfuscators, such as link . Remember that it is not a safe method, though.
Ja Right click can be blocked
As told by Edson
So:
document.oncontextmenu = document.body.oncontextmenu = function() {return false;}