Question:
How to change the view source on your site?
ohai.
2008-02-15 18:34:46 UTC
Theres a way so that you can change whats inside the view source button. When you right click you can put something like "This coding is not for distribute" I saw it on a site once...Please tell me?
Four answers:
Shell Answer Man
2008-02-15 21:42:30 UTC
If it's javascript or html on your site, I can snatch it.



What I can't snatch and call my own is GOOD MATERIAL. Make sure you have some. The html is moot.



Good luck.
Barrett
2008-02-15 18:50:33 UTC
Hi there,



To add to what Silent was saying...



If you are talking about the little box that pops up when people try to right click and view you source code.. and the box says it's not allowed on your site.. that is done with a javascript. There are several different ones that will give you that little pop up box, one can be found here:



http://www.dynamicdrive.com/dynamicindex9/noright.htm



As Silent was saying though, you can't completely block people from doing so because that only controls right click. People would still be able to click on View in their browser and select to see the source code.



Also, it wouldn't work on people who have javascript disabled in their browser. However, there are those that have no clue they can click on View to see it, so you might be able to trick some, but not many. Another thing I have seen people do is add the disable right click javascript, and then on the top line of the code put some note there and skip several lines before their actual code starts, trying to make it look like they can't see the actual code. Here again, only a few people are going to fall for those kinds of things.
SilentSleeper
2008-02-15 18:38:26 UTC
so you want to lock your view source by disabling the right click eh?

It's possible, but i would not recommend it.

I would go to the menu of the browser, and click on 'view', and the 'view source', and i would still be able to see your code.

If you would really like to hide your real code, use php or ajax, the show the html part of your website, but all the programming done is in php, which the browser successfully hides
2008-02-15 19:06:38 UTC
That is not possible. Your browser uses that code to serve you that page. Even if one browser allows it another borwser may still be able to show that code.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Continue reading on narkive:
Loading...