I was looking at a nice site today and when I tried to see their 'source code' or 'page source', nothing happened. So, how do you block someone from seeing your meta tags and such?

Is there a downside to doing this sort of thing?

Recommended Answers

All 4 Replies

I'm not sure if there is a code like that at w3schools.com but I think it's a javascript code that would hide the entire code of the page.

Disable java script and try viewing source.

Ive done a research on the web and it says that it is used it to keep people from stealing your content. They will probably have copy and paste disabled too. Theres still ways of seeing it. but i dont know how they do it

Ultimately there is nothing you can do to hide any source code that is served to the browser. Any attempts to hide that can be bypassed by simply using an HTTP viewer or other tool that reads directly from the webserver bypassing a browser (e.g., the HTTP viewer at http://www.rexswain.com/httpview.html).
This would include any source code in included javascript or css files.

You can try to obfuscate your code. For example, there are compression utilities for JavaScript that make it almost unreadable (look at Google's Javascript and you will see this). Still, a smart engineer could figure it out.

Note that code that is executed on the server, such as PHP, ASP, .NET, JSP, etc are NOT readable, as long as your server is configured to execute those files rather than return the source. Of course, if your server is not configured correctly, then a hacker might get into these. That is a whole other area -- making sure your server is safe from hackers.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.