This question already has an answer here:
I want to know can i hide the source code(special for HTML PAGE) from browsers.viewsource
?
if yes
than how ?
And if no
than other way to secure my page code ?
This question already has an answer here:
I want to know can i hide the source code(special for HTML PAGE) from browsers.viewsource
?
if yes
than how ?
And if no
than other way to secure my page code ?
As others said, you can't hide your code to the client because on the web, the client download all your html, javascript et css to be able to display it in its browser.
The only thing you could do is to obfuscate and minimze your code when building a release version of your website.
That way, you'll complicate the work of the "hacker" who trys to steal your code. http://en.wikipedia.org/wiki/Obfuscation_(software)
http://en.wikipedia.org/wiki/Minification_(programming)
Here's a example of Google's obfuscated code
If you are only trying to hide your HTML, you could create an empty DIV tag within your body tag and then use an ajax call back to your server to retrieve the rest of the HTML. Then you would do an insert into the div tag with
document.getElementById("div").innerHTML = ajax_content
to populate the div with your content.This will only hide your HTML from content authors who do not know about ajax/javascript coding. If they try to view the page source, they should only see the empty div tag.
This method is only a deterrent, not avoidance.
use flash version. user will be able to download flash, but is is harder (still possible?) to extract source.
You can't. You can make it a slight bit tricky to use the right-click menu on a page, but it remains trivial to access the source of the page. Don't expect to "secure" the code of your page.
No you cant do that.It is impossible to effectively hide the HTML.
You can read this as this will give you some other alternatives to secure your page.
Copied the content if in case the link goes dead in future.