Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: How do I get a link to actuate only if Ctrl and Shift are being held at the same time?


Message #1 by "Niko Warner" <solokin1@h...> on Mon, 20 Jan 2003 20:58:17
	Your disabled of <a> doesn't work maybe because this attribute isn't
standard.  I have an alternative:

<a href=3D"http://www.microsoft.com" onclick=3D"return false">
MS site is not responding :)</a>

> -----Message d'origine-----
> De : Roy Koczela [mailto:rkoczela@a...]
> Envoy=C3=A9 : mercredi 22 janvier 2003 01:42
> =C3=80 : javascript
> Objet : [javascript] RE: How do I get a link to actuate only
> if Ctrl and
> Shift are being held at the same time?
>
>
> well of course actually I make a class
> BUTTON.lnk { blah blah blah }
>
> and then the actual tags read:
>
> <BUTTON class=3D'lnk'>fdsfds</BUTTON>
>
> you are right, I could use an anchor tag, but my point was I
> do this because
> I hate the behavior of hyperlinks.  For instance let's say you want 
to
> disable one:
>
> <a href=3D"#" DISABLED>fdsfds</a>
>
> IE brilliantly grays it out, but does not really disable it. 
> When you click
> on it the action still takes place.
>
> Or you say
> <BUTTON id=3D'btnDisable'>Button that should not be clicked while 
slow
> function is running</BUTTON>
> <a href=3D"javascript:disablingFunction()">Do slow function</a>
> <a href=3D"javascript:whatever()">Do Something else</a>
> <script>
> function disablingFunction() {
> 	document.all['btnDisable'].disabled=3Dtrue;
> 	for (var k=3D0;k<10000000;k++) {
> 		runSlowCode();
> 	}
> 	document.all['btnDisable'].disabled=3Dfalse;
> }
> function whatever() {
> }
> </script>
>
> The user clicks on the first hyperlink.  It seems not to
> respond because it
> is running a slow function.  So he clicks on the second one. 
> IE brilliantly
> aborts the execution of the first function.  Therefore,
> btnDisable will
> never get reenabled.
>
> Buttons, on the other hand, IE treats rationally and finishes
> executing the
> code for one of them before starting to execute the code for
> the next one.
> Ergo buttons that look like links.
>
> -Roy
>

  Return to Index