[opencms-dev] Adding some JavaScript

Christian Steinert christian_steinert at web.de
Tue Dec 19 07:57:12 CET 2006


Sam2266 at gmx.de schrieb:
> Good morning everyone,
>
> I'm trying to insert a javascript that is valid for the hole website. The script would normaly be inserted in the <head> or in a separate .js file. It's decrypter to minimize spaming.
> <script> <!--
> function UnCryptMailto(s, shift) {
> 	var n=0;
> 	var r="";
> 	for(var i=0;i<s.length;i++) { 
> 		n=s.charCodeAt(i); 
> 		if (n>=8364) {n = 128;}
> 		r += String.fromCharCode(n-(shift)); 
> 	}
> 	return r;
> }
> function linkTo_UnCryptMailto(s, shift)	{
> 	location.href=UnCryptMailto(s, shift);
> }
> // --> </script>
> 	
> I would use for each email adress a script, so the bots would not find the mail adress that easy.. 
> Has anyone of you an idea in which .js file an in which folder do I have to insert this code? I know that there is a javascript file where all scriüts are, but I actually do not know where this file is.
>
> Thanks a lot for your help..
>
>   
You store your Javascript file into a new plain text file inside of any
folder of your website, for example /sites/default/myscript.js
Then you just change the header section of your JSP template and include
a <script> tag that points to your javascript file.

christian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3269 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20061219/c07d24db/attachment.bin>


More information about the opencms-dev mailing list