RE: Javascript question

by "Brett Errington" <brett(at)opensearch.com>

 Date:  Tue, 13 Aug 2002 17:15:12 +0800
 To:  <hwg-techniques(at)hwg.org>
 In-Reply-To: 
  todo: View Thread, Original
As a sidenote to your rebuttal

Return False can often send the page to a blank page with the words
FALSE written into the content. Therefore this is also not a perfect
solution. I was aware of this solution and suggested the other because
in practice I have found it less problematic.

Later,
Brett

"Oooooh... they have the Internet on computers now..." - Homer Simpson

-----Original Message-----
From: Romek aka webadmin [mailto:zylla(at)ipos.p.lodz.pl] 
Sent: Tuesday, 13 August 2002 5:36 PM
To: Brett Errington
Cc: designsbydusty(at)tiadon.com; mikemckee(at)cablespeed.com;
hwg-techniques(at)hwg.org
Subject: RE: Javascript question

At 09:27 13-08-02 +0800, you wrote:
>Yeah
>
>You shouldn't use # as the URL for the buttons (that's what causes the
>jump). Either you put the JavaScript command in the URL as so:

  Other and better IMHO  is to put the function call with
  return false at the end; like this

  <.a href=# onClick="setImage('cell_12'); return false;">

BTW1  And as I see the code of the game it can be made much shorter
  if we avoid plenty of  document.write in the table creation.
BTW2  One should consider to put  alt=""  and title=""  for
      the clickable images.  This way we can avoid  tooltips
     (or pop-up url or I don't know how we call it:) disturbing
      enjoing the game.

>
>href="javascript: doMyFunction();"

  It is fine except that in some browsers the URL-line of the browser
  shows  "javascript: doMyFunction()"  thus the original URL
  is missing.

>
>Or you use a method like void(); to stop it from doing anything.
>
>href="javascript: void();"

  Probably the same result as above.

  Anyway  you can see other games which use this technique at
  http://wipos.p.lodz.pl/zylla/games/hf.html
  http://wipos.p.lodz.pl/zylla/games/slide16b.html
  http://wipos.p.lodz.pl/zylla/games/parki3a.html

>
>Brett
>
>-----Original Message-----
>From: owner-hwg-techniques(at)hwg.org
[mailto:owner-hwg-techniques(at)hwg.org]
>On Behalf Of Dusty
>Sent: Tuesday, 13 August 2002 7:38 AM
>To: hwg-techniques(at)hwg.org
>Subject: Javascript question
>
>Anyway, here is the page:
>http://www.geocities.com/our_super_class/kneedeep.html
>
>Thanks,
>Dusty
>http://www.tiadon.com/designsbydusty/default.htm
>
>
--
Romek Zylla
~~~~~~~~~~~  after all the work done by Micro$oft (R)  ~~~~~~~~~~
        Personal Computer Science is an experimental one (C)
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA