Link to home
Start Free TrialLog in
Avatar of dresdena1
dresdena1

asked on

Javascript Disable View Source?

I would like to know if there is a javascript to disable "View Source" in IE or Netscape browsers?
Thanks,
dresdena1
Avatar of hagur
hagur

No, it's not possible.  You can disable right-clicking with some javascript code in both browsers, but users will still be able to goto the view > source menu.

There is a neat and easy trick in IE which is to put "onContextMenu="return false;" in the body tag.  This will disable the popup menu when you right-click.

But like I said earlier, users will still be able to use the menu to access the source.
There is a right click disable script here along with all the other methods that do not work to prevent access to images and source.

http://continue.to/hope

If you still think is is possible then visit here and look at the webmaster tools, to see what you must defeat to stop even the most inexperience user:

http://www.hereforlife.com/liberate.html

And of course you may want to look at the commercially available tools as well:

http://www.codelifter.com/index.html

If after that you still thingk you have found away to protect the source code, post the link where use are using it and I will have my nine-year old niece email you the code.

I'm sure you believe your source code is unique and has value, I guarantee you it does not, unless you have reinvented HTML.

IF teh source is that important to you, then don't put it on the 'net, because the moment you publish it it belongs to the world and there is nothing you can do to prevent othere from seeing it, saving it, using it, and modifying it.

Cd&
ASKER CERTIFIED SOLUTION
Avatar of PresidentUTA
PresidentUTA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That script is so lame a three year old could figure it out.

Cd&
It is better than nothin, and I am pretty sure he doesnt want to pay money :-P
Money has nothing to do with it.  There is nothing you can buy that will protect the contents of a web page.  If someone ever finds a way they will get very rich selling to developers who think that they are the only one that know how to do something on a web page.  LOL

Cd&
Avatar of dresdena1

ASKER

PresidentUTA,
 For what I am interested in, it is perfect.
Thanks very much.
dresdena1
Avatar of mbvvsatish
if there is a encrypter , there will be decrypter as well  to find out the scrambled source .