Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #21238

WAS: Make an anime that draws primes different from offsets number++ , it's a variant of ulam spiral

From Dr J R Stockton <reply1300@merlyn.demon.co.uk.invalid>
Newsgroups comp.lang.javascript
Subject WAS: Make an anime that draws primes different from offsets number++ , it's a variant of ulam spiral
Date 2013-09-09 19:38 +0100
Organization Home
Message-ID <FanH9boAXhLSFwaH@invalid.uk.co.demon.merlyn.invalid> (permalink)
References <2c5d4c48-eb2b-4ade-9a00-6dc5f50c8c87@googlegroups.com> <4L3Y5fIEr4KSFwEb@invalid.uk.co.demon.merlyn.invalid> <l0getk$ksp$1@news.albasani.net>

Show all headers | View raw


In comp.lang.javascript message <l0getk$ksp$1@news.albasani.net>, Sun, 8
Sep 2013 02:04:04, Stefan Weiss <krewecherl@gmail.com> posted:

>On 2013-09-07 22:21, Dr J R Stockton wrote:
>> FOR OTHERS ALSO :
>>
>> My pages contain shown code actuated by buttons.  Usually, it is thought
>> to be obvious that a given button just calls a certain function
>
>It's the most common case, but with event bubbling and capturing, and
>the possibility of attaching multiple listeners to an event, no such
>assumption should be made.

I meant that "obvious" to be taken in the context of the page section in
question and on the assumption that the page is intended to be helpful.


>> I have something partly like the following Form, in js-misc0.htm#SE :
>>
>> <form action="#">
>>
>>  <input type=text name=X size=6 value=333>
>>
>>  <input type=button value=" B " onClick="TA1.value=EratoB(+X.value)">
>>
>>  <input type=button value=" ? "
>>   onClick="TF=this.form ; eval(this.title)"
>>   title="TF.TA1.value=EratoB(+TF.X.value)">
>>
>>  <br><textarea name=TA1 rows=6 cols=66 readonly></textarea>
>>
>> </form>
>>
>>
>> There, the buttons do the same when clicked, except that the second
>> pollutes TF, wherever that may be, and hovering over the button reveals
>> its effective code.
>
>Without leakage:
>
> <input type=button value=" ? "
>  onClick="eval('TA1.value=' + this.title)"
>  title="EratoB(+X.value)">
>
>Still shows the relevant code in the title (which, I think, is what you
>wanted).

As title or as value; the preference depends on circumstances.

>> Untested : I suppose that I can use  onClick="Oozlum(this)" and define
>> Oozlum elsewhere.
>
>Of course you can. Personally, I would much prefer a helper function,
>compared to relying on the rather unintuitive identifier resolution in
>event attributes (even more so in form elements).

I was uncertain there.  Your code works in IE8, and in current Firefox
Opera Safari & Chrome.  Thanks.


-- 
 (c) John Stockton, nr London UK.  ?@merlyn.demon.co.uk  DOS 3.3, 6.20; WinXP.
  Web  <http://www.merlyn.demon.co.uk/> - FAQqish topics, acronyms and links.
   PAS EXE TXT ZIP via  <http://www.merlyn.demon.co.uk/programs/00index.htm>
   My DOS  <http://www.merlyn.demon.co.uk/batfiles.htm> - also batprogs.htm.

Back to comp.lang.javascript | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Make an anime that draws primes different from offsets number++ , it's a variant of ulam spiral jonas.thornvall@gmail.com - 2013-09-06 01:12 -0700
  Re: Make an anime that draws primes different from offsets number++ , it's a variant of ulam spiral Ken <usenet-so@abdiassoftware.com> - 2013-09-06 18:37 -0500
    Re: Make an anime that draws primes different from offsets number++ , it's a variant of ulam spiral jonas.thornvall@gmail.com - 2013-09-06 23:15 -0700
  Re: Make an anime that draws primes different from offsets number++ , it's a variant of ulam spiral Dr J R Stockton <reply1300@merlyn.demon.co.uk.invalid> - 2013-09-07 21:21 +0100
    Re: Make an anime that draws primes different from offsets number++ , it's a variant of ulam spiral Stefan Weiss <krewecherl@gmail.com> - 2013-09-08 02:04 +0200
      WAS: Make an anime that draws primes different from offsets number++ , it's a variant of ulam spiral Dr J R Stockton <reply1300@merlyn.demon.co.uk.invalid> - 2013-09-09 19:38 +0100

csiph-web