Hide "View Source" in HTML

Posted on 2009-04-15
Last Modified: 2012-08-14

I want to hide the "View Source" option in my HTML Page.
Is there any Java Script code which hides the "View Source" Option.

Thanks and Regards
Question by:PuneetKSaxena
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 13

Expert Comment

ID: 24146745
LVL 29

Expert Comment

by:David H.H.Lee
ID: 24146766
Hi PuneetKSaxena,
In one word - "No". You can have a lot of method to make novice difficult to access your source code. But, you can't stop user scrapping the HTML source other third party tool.
You can see the previous thread that i asked long time ago, hope it give you some insight for this matter:

Author Comment

ID: 24146786

In my case everything is building at runtime. XML is generated at run time and through XSL it is converted to HTML which is displayed in the browser, So i want some java script code to hide the view source option

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

LVL 13

Expert Comment

ID: 24146800
LVL 12

Accepted Solution

lexxwern earned 500 total points
ID: 24146951
Not possible.

Author Comment

ID: 24262743

Featured Post

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question