Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

View Source Hidden 1

Status
Not open for further replies.

soonkhoo

Programmer
Dec 8, 2000
133
MY
Is there a way to stop people from viewing source from the browser instead of right clicking? I remembered some people did it before, they have a popup window instead... with credits even. :) Nice
 
IE only:

<script>
function someFunc()
{
alert(&quot;Me&quot;);return false;
}
window.document.oncontextmenu=someFunc
</script> jared@aauser.com
 
To remove the menu when right clicking, set the onclick handler to your own function. You could include an alert() box or anything else you may want to do.

You could also put a layer over top of your content which contains a large transparent gif. Then, right clicking will pull up image options instead of view source, etc.
Sincerely,

Tom Anderson
CEO, Order amid Chaos, Inc.
 
Ultimately, there's no way to hide the source from the user. There's a very simple way around any method you might try. All these things do is place a small amount of inconvenience on the user.


Russ
bobbitts@hotmail.com
 
Of course you cannot hide the source... that is what your web browser uses to render the page. If you hit your webserver port (80 usually) and request a webpage, then your server will serve the page... that's what it's there for. So, even if your browser didn't have multiple ways for you to view the text version of the source, you could easily use telnet or your own CGI app to get it. Until HTTP accepts encrypted or compiled source (not anytime soon if ever), you will always have other people looking at it. It's no big deal really -- do you really think that you could ever do something which someone else couldn't easily figure out, if not have done already?
Sincerely,

Tom Anderson
CEO, Order amid Chaos, Inc.
 
I'm not trying to hide the source code away... I built questionaires using simple html .. but the answers could be viewed by checking the source code. Anyway, I have solved the problem, ....by opening a new window, cutting of the nav bar. And the right-clicking feature is disabled as well. Well, thanks for the info. It's helpful.

Soon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top