Just be aware that any visitor with a little computer knowledge can still get any content off of your pages.
If you are trying to stop someone stealing your images, all they need to do is drag the image to the address bar and they will see the image that is stored in their temporary internet files on their computer.
in the downloads section...but wullie is right, anyone who really wants to can still get you're image, try putting a copyright on the images via use of photoshop, ok?? I have not failed; I merely found 100,000 different ways of not succeding...
Using the cleardot.gif trick can be useful if your just trying to protect images, but like its been said, you only need a bit of computer knowledge to get the images anyway.
Disabling the right click function omly affects the actual main browser window, it does not stop a user from using the tabs on the top of their browser....
VIEW>SOURCE
There are also other ways to do it, by running an external page validator is just one of the ways. This will not be affected by a disabled right click.
A trick I have used on some of my sites is to open the page you want to stop them from stealing the code in using a popup window, but disabling the menu bars hence preventing them from using VIEW > SOURCE.
Team this with a right click disable script on the page and the vast majority of users will struggle to get your code.
I know most people don`t like popups but if you want to disable the whole of the site, have a splash screen and launch a full screen popup from there which will prevent any further popups. hmm, ok, confusing myself now!
Aishaa, another trick i'm aware of is placing like hunderd's of empty hard returns' on you're coding so the user thinks that there's no code...i've seen some sites do that...
I think that the code should be shared, that's how I learned how to do programming by looking at other ppl. coding and modyfing it, and if someone wants to learn from me then so be it...i only use the righ-click on my site to protect my images that I crated... I have not failed; I merely found 100,000 different ways of not succeding...
Hi rufc
I pasted this
<a href="#" onClick="MyWindow=window.open('redirect.htm','MyWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=???,height=???'); return false;">
in between the head and /head of my page, but it has not worked - am still able to view source from top browser tabs. What am i doing wrong?
I agree with all the members who say that's it's impossible to hide your code or whatever for users with a bit computer knowledge.
I also share the opinion that we all learned coding from reading other people's/company's sites. And we have to keep on sharing our knowledge.
But I also respect your opinion and let you decide for yourself what you think the best is for you, so here are some previous threads. Take the time to read it and see for your self. (try also a key-word search for yourself)
I totally agree that code should not be hidden as most of us (including me) have learned and still learn from other sites.
As I mentioned before, running an external validator on the page in question will return the source code no matter what right click script or other trick mentioned.
You are trying to hide your source code. This means that it is going to be other designers that you are hiding it from, the people you are hiding the code from are going to have knowledge of how to get the code even if you open an external window with the toolbars removed and a disabled right click.
The point I put to you is, where would we all be if all of our code was kept secret? This forum for one, would only have a few posts on it. Nobody would help others as they wouldn`t want to give away their secrets...
I personally have only been designing sites for about a year and wouldn`t have been if I hadn`t picked up code snippets here and there and also if I hadn`t had this forum.. Tek-tips has been invaluable to me...
You could put all the tricks mentioned together and add some more, some people might not get your code, but I guarantee that if you post the url here someone will get your source code quicker than you disabled it..
Disable scripts only work (someofthetime) with PC's. It doesn't work on MAC's. And I agree, like everyone says one can still get the stuff they want from your page.
You could try putting your images in Applets.
You could try encrypting your whole page
try replacing the ??? with the actual pixel size of the window you want to open, and also use the code as a usual a href code (so it goes before the link you want to open in a new window)(also needs a closing /a tag)
Regarding the 'should we share our code' debates, I myself learnt everything I know from other peoples sites andreading books and readily leave my code open for anyone to take a look at.
BUT, on some occasions I have spent hours creating a new unique effect/layout to make my sites different from the rest, on these occasions I prefer to keep my coding secret (unless someone emails me asking for it in which case I have given it out in the past). I understand that many people can still get at code no matter what you do, but make it as hard as possible for them.
Just worth noting, it's bloody hard to reverse engineer a *.swf file, so if your really paranoid about your code, try doing your entire site in flash. Of course, that brings in a whole host of other problems, but thats another debate! "The surest sign that intelligent life exists elsewhere in the universe is that it has never tried to contact us"
Bill Watterson, Calvin & Hobbes
Well...since we're talking about hiding code, I'm gonna mention that you could also use a script, and load the entire page into a variable and then use insertAdjacentHTML to display the page. You could then have the script in an external file, or even multiple different files with lots of functions all calling each other that just load a couple of variables. Users can still see the code but you can make it really hard to find out what it's doing.
MNClimber, boy that's alot to do especialy for someone who wants to hide thier coding...I still believe that unless the coding is not sensitive information, it shouldn't be hidden...alot of start-up programmer's actually learn programming (javascript, HTML, vbScript) from looking at other people's coding then they do from reading those books or taking classes...
Maybe that's just my opinion... I have not failed; I merely found 100,000 different ways of not succeding...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.