A topic of concern in Linux

Darragh lists at digitaldarragh.com
Tue Jan 20 18:20:44 EST 2004


Here are two common scripts that I use.

This doesn't stop users completely from right clicking on my site but it
certainly makes it more difficult.

<script LANGUAGE="JavaScript">
<!--var message="Sorry, You do not have permission to Right-Click on this
Page.";
function click(e) {
 if (document.all) {
  if (event.button == 2) {
   alert(message);
   return false;
  }
 }
 if (document.layers) {
  if (e.which == 3) {
   alert(message);
   return false;
  }
 }
}
 if (document.layers) {
  document.captureEvents(Event.MOUSEDOWN);
 }
document.onmousedown=click;

functions for validating a form. .
function echeck(str) {

  var at="@"
  var dot="."
  var lat=str.indexOf(at)
  var lstr=str.length
  var ldot=str.indexOf(dot)
  if (str.indexOf(at)==-1){
     alert("Invalid E-mail address")
     return false
  }

  if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
     alert("Invalid E-mail address")
     return false
  }

  if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 ||
str.indexOf(dot)==lstr){
      alert("Invalid E-mail address")
      return false
  }

   if (str.indexOf(at,(lat+1))!=-1){
      alert("Invalid E-mail address")
      return false
   }

   if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
      alert("Invalid E-mail address")
      return false
   }

   if (str.indexOf(dot,(lat+2))==-1){
      alert("Invalid E-mail address")
      return false
   }

   if (str.indexOf(" ")!=-1){
      alert("Invalid E-mail address")
      return false
   }

    return true
 }
function ValidateForm(){
 var emailID=document.Feedback.emailaddress

 if (Feedback.name.value == ""){
  alert("Please enter your name.  You must fill out fields marked with a
*");
  Feedback.name.focus();
  return;
 }

 if ((emailID.value==null)||(emailID.value=="")){
  alert("Please Enter your Email address.  Fields marked with a * must be
completed")
  emailID.focus()
  return false
 }
 if (echeck(emailID.value)==false){
  emailID.value=""
  emailID.focus()
  return false
 }
 return true
 }
//-->
</script>
----- Original Message -----
From: <davros at ycardz.com>
To: <speakup at braille.uwo.ca>
Sent: Tuesday, January 20, 2004 9:51 PM
Subject: Re: A topic of concern in Linux


I know it's heavily used, but why is it better and/or more useful? More to
the point, how does its proper use make it more effective than not using
it, especially in light of all the ways it's used to, as the Car Talk guys
say, obfuscate and de-clarify?

Original Message:
-----------------
From: Alex Snow alex_snow at gmx.net
Date: Tue, 20 Jan 2004 15:42:16 -0500
To: speakup at braille.uwo.ca
Subject: Re: A topic of concern in Linux


it is heavily used in navigation and forms. I have built several
websites that use javascript navigation and basic form varification
such as email addresses and stuff.
On Tue, Jan 20, 2004 at 02:01:07PM
-0500, Buddy Brannan wrote:
> On Tue, Jan 20, 2004 at 01:01:04PM -0500, Alex Snow wrote:
> > I don't know why everyone hates javascript so much. from a web
> > developer's point of view it's an extremely powerful tool.On Mon, Jan
>
> Care to back this up with some examples of where Javascript actually
> creates useful functionality (as opposed to gratuitous eye-candy)?
> --
> Buddy Brannan, KB5ELV/3    | But I will lay my burden
> Email: davros at ycardz.com   | in the cradle of your grace,
> ICQ: 36621210              | And the shining beaches of your love,
> http://www.ycardz.com      | and the sea of your embrace.--Dave Carter
>
> _______________________________________________
> Speakup mailing list
> Speakup at braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup

--
Always borrow money from a pessimist; he doesn't expect to be paid
back.


_______________________________________________
Speakup mailing list
Speakup at braille.uwo.ca
http://speech.braille.uwo.ca/mailman/listinfo/speakup

--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .



_______________________________________________
Speakup mailing list
Speakup at braille.uwo.ca
http://speech.braille.uwo.ca/mailman/listinfo/speakup





More information about the Speakup mailing list