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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hide Source

Status
Not open for further replies.

Nunina

Programmer
Mar 5, 2003
128
PR
Hi Guys!

I want to hide the source of my page, so that when the visitor selects View --> Source, nothing shows.

Is there a way to do that?

Thanks!

[gorgeous]

Issys Pouerie
Systems Support Analyst
San Juan, Puerto Rico
 
The source will have to be available on the visitor's machine in order to display it so hiding it completely is not possible.
Keith
 
But is there any way to hide any of it anyway?

Thanks

[gorgeous]

Issys Pouerie
Systems Support Analyst
San Juan, Puerto Rico
 
Hi Nunina,
I have responded to similar query before regarding protecting images. You can insert some code to prevent users getting a right-click menu.

The code is as follows: (I got this from dynamicdrive.com)
Add the code to the <BODY> section of your webpages. (Change the line that says "Function Disabled!" to your own messgae if you wish)
-----------------------------------------------------------


<script language=JavaScript>
<!--

//Disable right mouse click Script
//By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
//For full source code, visit
var message="Function Disabled!";

///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")

// -->
</script>


-----------------------------------------------------------
Regards
Liam

If you can help, GREAT
If I can help, EVEN BETTER
 
you cannot hide your code.
it has to be downloaded to see it.

the above right click stopper does not prevent your images or code being saved.

whats so secret about some html code anyway. ?

Aaron Taylor
John Mutch Electronics
 
Hi

Is just that is kinda long, and it has a database linked to it.

But I'll be trying liamm's suggestion today, and I'll let you know.




[gorgeous]

Issys Pouerie
Systems Support Analyst
San Juan, Puerto Rico
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top