CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Where to put Standard (no richt click) java script

Print topic Send  topic

Author Message
Snorky
Posted: 02/17/2003, 9:56 PM

Hello everybody,

I have the following question.
Would like to add a Javascript to every page in my project (about 70 pages).
The Javascript would prevent the richt click button of the mouse.

Question? Can I do this one time so that it is automatically inserted in all pages?
Question? Where do I insert this in any case?

Using CCS 1.0.7 and PHP

The Javascript I use is the following:
<script language="Javascript1.2">
// From begin to end : copy the script in HEAD
//
//
// ***********************************************
// AUTHOR: WWW.CGISCRIPT.NET, LLC
// URL: http://www.cgiscript.net
// Use the script, just leave this message intact.
// Download your FREE CGI/Perl Scripts today!
// ( http://www.cgiscript.net/scripts.htm )
// ***********************************************

message = "Copyright protected, please do not copy any material from this site";

function NoRightClick(b) {
if(((navigator.appName=="Microsoft Internet Explorer")&&(event.button > 1))
||((navigator.appName=="Netscape")&&(b.which > 1))){
alert(message);
return false;
}
}
document.onmousedown = NoRightClick;

// -->
</script>
RipCurl
Posted: 02/18/2003, 4:38 PM



Question is why? What are you trying to stop? Theft of images? the no-right click is only a deterence, but when soeone visits your site, they already cache whatever is displayed in your page into their browser (under temporary internet files).

Disabling right click only annoys people (like me). I surf without javascript turned on anyway, so what is the use of it? And only makes those who visit your page, WANT to try and get around it (easily by just turning off JS anyway).

If you want to protect your images or content, dont publish it to the web. You have to expect that people will obtain copies of your material, that is the nature of the interent. You can't prevent someone from caching your site, which will grab the contents of your page anyway.
Snorky
Posted: 02/18/2003, 4:53 PM

Hi RipCurl,

I fully understand your reasoning and respect your opinion.

However, the reason why I want to do this is not the one that you suggest.
I would like to use it for an closed web application where graphics are obsolete.
These pages will not be published to the public.
The pages will also be served using a VPN connection.

The right click mouse disable is more or less a limitation to the enduser.
Accept for limitation purpose, this also gives a more application style
experience instead of a internet surfing experience.

However, in general, regarding surfing the public internet I fully agree with you.

Thank you for sharing your opinion.
DaveRexel
Posted: 02/18/2003, 5:39 PM

Why don't you use a multi file search & replace?

This is available in better text editors (UltraEdit, CrimsonEditor etc)

Greetings
Dave
Snorky
Posted: 02/18/2003, 11:54 PM

Hi DaveRexel,
I use UtraEdit myself.
Have experimented with your idea.
Did a search and replace in the .html files within the project directory.
Have putten the script right under the </head> tag.
It works ok.
Thx.

However, new pages have to be done seperately.
So I would have prefered that CCS had a buildin concept for implementing global scripts.
Per Jansson
Posted: 02/19/2003, 3:03 AM

Hi,
You can put the Javascript in a HTML template file that CCS will use everytime you create a new page.

Per

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.