Forum Moderators: mack
There is a comprehensive discussion here too:
[webmasterworld.com...]
You could try irritating users by stopping them right-clicking using javascript, but even that's not infallible and in my opinion it looks incredibly amaturish and not something that should ever be used on a professional website - especially when there are legitimate reasons for your users wanting to keep the right click/context menu functionality.
- Tony
[edited by: Dreamquick at 10:56 am (utc) on Oct. 15, 2003]
Why do you want to disable this?
The WWW by definition should be a free and accessible resource (IMO ;) )
There are an number of ways to do it (eg. javascript) but in all but the most advanced cases you will always be exposing you code.
Disable code>> user saves page>> disabale save page>> begin challenge for hacks >> beat off hacks >> encourage batter hacks >> site grafitti >> remove and improve >> word'll get out and they'll come after you..... snowball is getting bigger ..
Long answer short; if your site is on the web, anyone can get your source code.
Jordan
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title>My WebSite Title</title><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><meta name="title" content="mytitle" /><meta name="description" content="mydescription"/><meta name="keywords" content="mykeywords" /><!--css files--><style type="text/css"><!-- @import url(/mystyle.css); --></style><!--end css files--><!--javascript files--><script language="javascript" type="text/javascript" src="/js2.js"></script><script language="javascript" type="text/javascript" src="/js1.js"></script><!--end javascript files--></head><body>My WebPage</body></html>
Most people won't want to go through the headache of cutting and pasting into an html editor to sort it out.
cut'n'paste to Word.
Edit, find replace. Find: "<" replace with "^p<"
Clear as day.
If I want to be fussy a second replace of "^p</" with "</" will bring the close tags back onto the same line as the open tags.
At the end of the day, it's just not worth the effort and the impact of annoying genuine users to try and hide source code.
Jordan
More important is to stop anyone getting hold of your CGI scripts. That's where the really interesting and unique stuff on your site resides.
If you are exposing your CGI directories to casual passers-by, then think again!
may be im worrying bout stuff that has no sense at all (like hiding my source code)...im just starting
Then the chances are that you don't have anything worth protecting. I don't have any secrets worth protecting and I'm at least an intermediate.
Since I try to write valid code that works in multiple browsers, it is my hope that people will steal from me, though I would prefer they steal from someone who writes cleaner code yet... in other words the same people I steal from!
Someone once warned Woody Guthrie that another singer had stolen one of his songs. Woody said "Oh, he ain't nothin'. He just steals from me, but I steal from everybody."
So Joan - share with everyone, steal from everyone. In the long run you'll have much better pages.
One last thing. Occasionally, when I come across a page that doesn't work and I think I would like the person who wrote the page (for whatever reason, but usually for a small business that I like but is likely losing business because of a bad page), I'll sometimes use view source, see what's wrong and send them a quick note on how to fix it. I would say at this point, I do that more often than I look at the source in order to steal things.
When I want to steal something good, I usually ask how to do it in one of the WebmasterWorld forums and steal from someone who knows what he's talking about ;-)
Tom
ronin - sorry dude, won't make anyone curious about the code hesitate for a second.cut'n'paste to Word.
Edit, find replace. Find: "<" replace with "^p<"
Nah, just run it through Tidy and it will be all indented, any unmatched tags signalled and so on. It'll look better than typical Frontpage code.
Tom
The site I'm working on, I've been working on for over
a year now, and still haven't gotten it up and running,
but when it's on line, I don't think many people will
steal from me, as I don't have any fancy scripts, and
only one small java script (that I didn't write) for the
date and time on my site.
I spent the entire day trying to get everything checked
out on my new website, so I could start sending out the
URL. I spent about three hours trying to figure out why
the Pay Pal buttons wouldn't show up right on 50 of my
catalog pages, I finally had to remove all of the Pay
Pal code and reinstall it on each page. The Pay Pal code
was written by Pay Pal and is the most complicated code
on my site.